4 ms·
Wow, that worked, thanks!!! WEB> (declaim (optimize (debug 0) (safety 0) (speed 3))) NIL WEB> (defun nth-fibonacci (n &optional (a 0) (b 1)) (if (= n
by gibsonf1 5y ago
Wow, that worked, thanks!!!
WEB> (declaim (optimize (debug 0) (safety 0) (speed 3)))
NIL
WEB> (defun nth-fibonacci (n &optional (a 0) (b 1))
(if (= n 0)
a
(nth-fibonacci (- n 1) b (+ a b))))
WARNING: redefining LOBE/SRC/WEB::NTH-FIBONACCI in DEFUN
NTH-FIBONACCI
WEB> (time (nth-fibonacci 9999))
Evaluation took:
0.002 seconds of real time
0.001887 seconds of total run time (0.001887 user, 0.000000 system)
100.00% CPU
5,476,446 processor cycles
4,715,760 bytes consed