aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/intfact.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-06-13 16:37:27 +0000
committerdos-reis <gdr@axiomatics.org>2010-06-13 16:37:27 +0000
commit701073966d9aba091a99aa3cbef48fe3df226dfe (patch)
treeed595066e9e5e307fa4b86c9eb3852145965ac3f /src/algebra/intfact.spad.pamphlet
parent9a4759f38f13d4bf79133846eb5fd2aff58b2235 (diff)
downloadopen-axiom-701073966d9aba091a99aa3cbef48fe3df226dfe.tar.gz
* algebra/array1.spad.pamphlet (IndexedFlexibleArray) [merge!]: Tidy.
* algebra/intfact.spad.pamphlet (IntegerRoots) [perfectNthRoot]: Likewise. * algebra/numode.spad.pamphlet (NumericalOrdinaryDifferentialEquations) [rf4a]: Likewise. * algebra/solvelin.spad.pamphlet (LinearSystemMatrixPackage) [aSolution]: Likewise.
Diffstat (limited to 'src/algebra/intfact.spad.pamphlet')
-rw-r--r--src/algebra/intfact.spad.pamphlet5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/algebra/intfact.spad.pamphlet b/src/algebra/intfact.spad.pamphlet
index 00c54b24..8615cf7f 100644
--- a/src/algebra/intfact.spad.pamphlet
+++ b/src/algebra/intfact.spad.pamphlet
@@ -271,13 +271,14 @@ IntegerRoots(I:IntegerNumberSystem): Exports == Implementation where
perfectNthPower?(b, n) == perfectNthRoot(b, n) case I
perfectNthRoot n == -- complexity (log log n)**2 (log n)**2
- m:NNI
one? n or zero? n or n = -1 => [n, 1]
e:NNI := 1
p:NNI := 2
while p::I <= length(n) + 1 repeat
- for m in 0.. while (r := perfectNthRoot(n, p)) case I repeat
+ m: NNI := 0
+ while (r := perfectNthRoot(n, p)) case I repeat
n := r::I
+ m := m + 1
e := e * p ** m
p := convert(nextPrime(p::I))@Integer :: NNI
[n, e]