Skip to content

Commit 718b1cf

Browse files
committed
Reduce size of temporary Zeckendorf array
1 parent 5944926 commit 718b1cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

archive/a/algol68/zeckendorf.alg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ PROC zeckendorf = (INT n) REF [] INT:
8888

8989
# Allocate temporary space for Zeckendorf values #
9090
INT num fibs := UPB fibs;
91-
REF [] INT temp results := HEAP [1:num fibs] INT;
91+
REF [] INT temp results := HEAP [1:ENTIER((num fibs + 1) / 2)] INT;
9292

9393
# Going from largest to smallest, repeat until no more Fibonacci numbers #
9494
# left or sum of Fibonacci numbers is equal to n #

0 commit comments

Comments
 (0)