14 lines
323 B
Text
14 lines
323 B
Text
100 iterate
|
|
110 end
|
|
120 sub iterate()
|
|
130 iter = 0
|
|
140 phi0 = 1
|
|
150 do
|
|
160 phi1 = 1+(1/phi0)
|
|
170 diff = abs(phi1-phi0)
|
|
180 phi0 = phi1
|
|
190 iter = iter+1
|
|
200 loop until (1.000000E-05 > diff)
|
|
210 print "Result: ";phi1;" after ";iter;" iterations"
|
|
220 print "The error is approximately ";phi1-(0.5*(1+sqr(5)))
|
|
230 end sub
|