17 lines
288 B
Text
17 lines
288 B
Text
precision 6
|
|
|
|
define i = 0, d = 0, phi0 = 1, phi1 = 0
|
|
|
|
do
|
|
|
|
let phi1 = 1 / phi0 + 1
|
|
let d = abs(phi1 - phi0)
|
|
let phi0 = phi1
|
|
let i = i + 1
|
|
|
|
wait
|
|
|
|
loopuntil .00001 > d
|
|
|
|
print "result: ", phi1, " after ", i, " iterations"
|
|
print "the error is approximately ", phi1 - (.5 * (1 + sqrt(5)))
|