Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -1,15 +1,15 @@
|
|||
;;; Global variable (bigints); can be isolated in a namespace if need be
|
||||
;;; Global variable (bigints); can be isolated in a namespace if need be
|
||||
(setq stack '(0L 1L))
|
||||
;
|
||||
;;; If the stack is too short, complete it; then read from it
|
||||
;;; Adding at the end of a list is optimized in NewLisp
|
||||
;;; If the stack is too short, complete it; then read from it
|
||||
;;; Adding at the end of a list is optimized in NewLisp
|
||||
(define (fib n)
|
||||
(while (<= (length stack) n)
|
||||
(push (+ (stack -1) (stack -2)) stack -1))
|
||||
(stack n))
|
||||
(while (<= (length stack) n)
|
||||
(push (+ (stack -1) (stack -2)) stack -1))
|
||||
(stack n))
|
||||
;
|
||||
;;; Test (~ 7+ s on my mediocre laptop)
|
||||
;(println (time (fib 50000)))
|
||||
;;; or
|
||||
;;; or
|
||||
(println (length (fib 50000)))
|
||||
;;; outputs 10450 (digits)
|
||||
;;; outputs 10450 (digits)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue