aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/intfact.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-06-21 03:16:39 +0000
committerdos-reis <gdr@axiomatics.org>2010-06-21 03:16:39 +0000
commitafaaaac2b55741bfe43099f819fd4a9592b1c022 (patch)
tree7a5bbd28009759b1c787d3df4c4ba5960cd11280 /src/algebra/intfact.spad.pamphlet
parent640d839b4de4d0daf0dde00ba08eab6d264160ad (diff)
downloadopen-axiom-afaaaac2b55741bfe43099f819fd4a9592b1c022.tar.gz
Revert previous erroneous commit
Diffstat (limited to 'src/algebra/intfact.spad.pamphlet')
-rw-r--r--src/algebra/intfact.spad.pamphlet18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/algebra/intfact.spad.pamphlet b/src/algebra/intfact.spad.pamphlet
index dc7629d1..8615cf7f 100644
--- a/src/algebra/intfact.spad.pamphlet
+++ b/src/algebra/intfact.spad.pamphlet
@@ -151,10 +151,8 @@ IntegerPrimesPackage(I:IntegerNumberSystem): with
nm1 := n-1
q := (nm1) quo two
- k: NonNegativeInteger := 1
- while not odd? q repeat
- q := q quo two
- k := k + 1
+ k : NonNegativeInteger
+ for k in 1.. while not odd? q repeat q := q quo two
-- q = (n-1) quo 2**k for largest possible k
n < JaeschkeLimit =>
@@ -459,10 +457,8 @@ IntegerFactorizationPackage(I): Exports == Implementation where
if n<d*d then
if n>1 then ls := concat!(ls, ["prime",n,1]$FFE)
return makeFR(1, ls)
- m: Integer := 0
- while zero?(n rem d) repeat
- n := n quo d
- m := m + 1
+ m : Integer
+ for m in 0.. while zero?(n rem d) repeat n := n quo d
if m>0 then ls := concat!(ls, ["prime",d,convert m]$FFE)
d := d+s
@@ -500,10 +496,8 @@ IntegerFactorizationPackage(I): Exports == Implementation where
insert!(x+y,a,c)
insert!(x-y,a,c)
(d := PollardSmallFactor20 n) case I =>
- m': NonNegativeInteger := 0
- while zero?(n rem d) repeat
- n := n quo d
- m' := m' + 1
+ m' : NonNegativeInteger
+ for m' in 0.. while zero?(n rem d) repeat n := n quo d
insert!(d, a, m' * c)
if n > 1 then insert!(n, a, c)
-- an elliptic curve factorization attempt should be made here