Recursive Functions (58)

17 Name: #!/usr/bin/anonymous : 2008-02-15 15:55 ID:Heaven

>>16 That's very clever. It seems to lose accuracy around fib(72). More accuracy means adding more accuracy to PI, and that means you'd need a constant-time function to find bits of PI.

I do notice that the CL version has fewer "parens" (braces, semicolons, etc) than the C version >>6 wrote.

(defun fib (n)
(loop repeat n
with p = 0 and q = 1
do (psetq p q q (+ p q))
finally (return p)))
This thread has been closed. You cannot post in this thread any longer.