aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/intfact.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/intfact.spad.pamphlet')
-rw-r--r--src/algebra/intfact.spad.pamphlet3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/algebra/intfact.spad.pamphlet b/src/algebra/intfact.spad.pamphlet
index f405476f..f24922c5 100644
--- a/src/algebra/intfact.spad.pamphlet
+++ b/src/algebra/intfact.spad.pamphlet
@@ -324,7 +324,8 @@ IntegerRoots(I:IntegerNumberSystem): Exports == Implementation where
s := shift(s, n)
return ((1 + s + a quo s) quo two)
-- initial approximation for the root is within a factor of 2
- (new, old) := (shift(1, n quo two), 1)
+ old: I := 1
+ new: I := shift(1, n quo two)
while new ~= old repeat
(new, old) := ((1 + new + a quo new) quo two, new)
new