diff options
author | dos-reis <gdr@axiomatics.org> | 2008-05-18 15:34:10 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-05-18 15:34:10 +0000 |
commit | 46845584742ea3a47f7fa9a1738dd43ad51fbc61 (patch) | |
tree | aa1f95f7cca6c10cfd79a9d84292c9efd186f04d /src/algebra | |
parent | 8edea6260441e0835a1d6a3caff6be106efbe285 (diff) | |
download | open-axiom-46845584742ea3a47f7fa9a1738dd43ad51fbc61.tar.gz |
Fix AW/340
* algebra/numtheor.spad.pamphlet
(divisors$IntegerNumberTheoryFunctions): Fix thinko.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/numtheor.spad.pamphlet | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/algebra/numtheor.spad.pamphlet b/src/algebra/numtheor.spad.pamphlet index 1071d36d..6954e930 100644 --- a/src/algebra/numtheor.spad.pamphlet +++ b/src/algebra/numtheor.spad.pamphlet @@ -435,16 +435,15 @@ IntegerNumberTheoryFunctions(): Exports == Implementation where numer(n * r) divisors n == - oldList : List Integer := concat(1,nil()) - newList : List Integer + oldList : List Integer := [1] for f in factors factor n repeat - newList := nil() - for k in 0..f.exponent repeat + newList := oldList + for k in 1..f.exponent repeat pow := f.factor ** k for m in oldList repeat newList := concat(pow * m,newList) oldList := newList - sort(#1 < #2,newList) + sort(#1 < #2,oldList) numberOfDivisors n == n = 0 => 0 |