aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-05-18 15:34:10 +0000
committerdos-reis <gdr@axiomatics.org>2008-05-18 15:34:10 +0000
commit46845584742ea3a47f7fa9a1738dd43ad51fbc61 (patch)
treeaa1f95f7cca6c10cfd79a9d84292c9efd186f04d /src
parent8edea6260441e0835a1d6a3caff6be106efbe285 (diff)
downloadopen-axiom-46845584742ea3a47f7fa9a1738dd43ad51fbc61.tar.gz
Fix AW/340
* algebra/numtheor.spad.pamphlet (divisors$IntegerNumberTheoryFunctions): Fix thinko.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/algebra/numtheor.spad.pamphlet9
2 files changed, 10 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5919c53a..5f7308ec 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-18 Martin Rubey <martin.rubey@univie.ac.at>
+
+ Fix AW/340
+ * algebra/numtheor.spad.pamphlet
+ (divisors$IntegerNumberTheoryFunctions): Fix thinko.
+
2008-05-18 Gabriel Dos Reis <gdr@cs.tamu.edu>
* algebra/alql.spad.pamphlet (IndexCard): Don't use pretend.
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