/** Print ascending members of the Fibonacci sequence that are representable as 64-bit signed integers, prefixed by their term numbers, and followed by the ratio of successive terms, to demonstrate the 1.618...^n growth (the ratio approaches the golden ratio, (1 + sqrt(5))/2 = 1.6180339887498949, and reaches it (to machine precision) at 41 terms: the fourth item on each line is the difference from the golden ratio). */ FPPREC : 16$ FLOAT2BF : TRUE$ lo : 1$ hi : 1$ n : 1$ golden_ratio : (1.0B0 + SQRT(5.0B0))/2.0B0$ PRINT (FLOAT(golden_ratio))$ PRINT(n, lo)$ FOR n : 2 STEP 1 WHILE hi < 2^63 DO BLOCK ( ratio : hi/lo, PRINT(n, hi, BFLOAT(ratio), BFLOAT(ratio - golden_ratio)), hi : lo + hi, lo : hi - lo )$