(defconstant GOLDEN-RATIO (/ (+ 1.0d0 (sqrt 5.0d0)) 2.0d0)) (defun Fibonacci () "Print a table of representable Fibonacci sequence values. Lisp supports bignums, but we limit the output to values representable in 64-bit integers to make the output comparable to that from other programming languages." (format t "~2D~A~25D~%" 1 #\Tab 1) (do* ((hi 1 (+ lo hi)) (lo 1 (- hi lo)) (n 2 (1+ n)) (ratio #1=(float (/ hi lo) 1.0d0) #1#)) ((>= hi #.(1- (expt 2 63)))) (format t "~2D~A~25:D~A~19,15F~A~19,15F~%" n #\Tab hi #\Tab ratio #\Tab (- ratio GOLDEN-RATIO)))) (Fibonacci)