(use-modules (ice-9 format))		;load the (format ...) command, sigh...

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

(define (Fibonacci)
  "Print a table of representable Fibonacci sequence values."
  (let ((hi 1)
	(lo 1)
	(n 1)
	(ratio 0))
    (format #t "~2d~/~25:d~%" n lo)
    (while (< hi (expt 2 63))
	   (set! n (1+ n))
	   (set! ratio (/ (exact->inexact hi) (exact->inexact lo)))
	   (format #t "~2d~/~25:d~/~19,15f~/~19,15f~%"
		   n hi ratio (- ratio GOLDEN-RATIO))
	   (set! hi (+ lo hi))
	   (set! lo (- hi lo)))))

(Fibonacci)
(exit)
