### ======================================================================
### Print a table of representable Fibonacci sequence values.   Python
### supports big integers (more than 64 bits), so for comparison with
### other languages, we limit to the loop to 64-bit values
###
### Usage:
###	python Fibonacci3.py
###
### [19-Apr-2002]
### ======================================================================

import math;

def Fibonacci():
    lo = hi = n = 1
    golden_ratio = (1.0 + math.sqrt(5.0))/2.0
    limit = 2**63 - 1
    print "%3d\t%19.0f" % (n, lo)
    while hi < limit:
	n = n + 1
	ratio = (hi + 0.0) / (lo + 0.0)
	print "%2d\t%19.0f\t%19.15f\t%19.15f" % (n, hi, ratio, (ratio - golden_ratio))
	hi = lo + hi
	lo = hi - lo

Fibonacci()
