1 REM https://rosettacode.org/wiki/Golden_ratio/Convergence 10 LET phi0 = 1 20 LET phi1 = 1 / phi0 + 1 30 LET d = ABS(phi1 - phi0) 40 LET phi0 = phi1 50 LET i = i + 1 60 IF d >= .00001 THEN 20 70 PRINT "result: "; phi1; " after "; i; " iterations" 80 PRINT "the error is approximately "; phi1 - (.5 * (1 + SQR(5)))
Return to Example Index