diff options
Diffstat (limited to 'src/algebra/numtheor.spad.pamphlet')
-rw-r--r-- | src/algebra/numtheor.spad.pamphlet | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/algebra/numtheor.spad.pamphlet b/src/algebra/numtheor.spad.pamphlet index f1251618..4a8101ea 100644 --- a/src/algebra/numtheor.spad.pamphlet +++ b/src/algebra/numtheor.spad.pamphlet @@ -335,8 +335,8 @@ IntegerNumberTheoryFunctions(): Exports == Implementation where fibonacci n == n = 0 => 0 negative? n => (odd? n => 1; -1) * fibonacci(-n) - f1, f2 : I - (f1,f2) := (0,1) + f1: I := 0 + f2: I := 1 for k in length(n)-2 .. 0 by -1 repeat t := f2**2 (f1,f2) := (t+f1**2,t+2*f1*f2) |