(defconst GOLDEN-RATIO (/ (+ 1.0 (sqrt 5.0)) 2.0))

(defun Fibonacci ()
  "Print a table of representable Fibonacci sequence values.  Emacs
Lisp limits integers to 27 bits, so the loop terminates earlier than
in other programming languages."
  (let ((hi 1)
	(lo 1)
	(n 1)
	(ratio))
    (princ (format "%2d\t%25d\n" n lo))
    (while (> hi 0)
      (setq n (1+ n))
      (setq ratio (/ (float hi) (float lo)))
      (princ (format "%2d\t%25d\t%19.15f\t%19.15f\n"
		     n hi ratio (- ratio GOLDEN-RATIO)))
      (setq hi (+ lo hi))
      (setq lo (- hi lo)))))

(Fibonacci)
