The Remarkable Convergence of Phi

Started by Charles Pegge, February 10, 2024, 10:51:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Charles Pegge

Phi is extremely robust: you can calculate it from any 2 integers, positive or negative as long as one of them is non-zero.

'09/02/2024
'phi convergence
uses console
int a,b,c
do
  print "enter an integer -20..20 "
  a=input
  print cr
  print "enter another integer -20..20 "
  b=input
  print cr
  if a=0 and b=0 then exit do
  while abs(a)<1e8
    print a tab b cr
    c=b
    b=a+b
    a=c
  wend
  print cr
  print "phi ratio (small): " a/b cr
  print cr cr cr
loop