Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
Procedure using_Float()
|
||||
Define iter.i = 0
|
||||
Define.f phi0 = 1.0, phi1, diff
|
||||
Repeat
|
||||
phi1 = 1.0 + (1.0 / phi0)
|
||||
diff = Abs(phi1 - phi0)
|
||||
phi0 = phi1
|
||||
iter + 1
|
||||
Until (1.0e-5 > diff)
|
||||
|
||||
PrintN("Using type Float --")
|
||||
PrintN("Result: " + FormatNumber((phi1), 10) + " after " + Str(iter) + " iterations")
|
||||
PrintN("The error is approximately " + FormatNumber((phi1 - (0.5 * (1.0 + Sqr(5.0)))), 10))
|
||||
EndProcedure
|
||||
|
||||
Procedure using_Double()
|
||||
Define iter.i = 0
|
||||
Define.d phi0 = 1.0, phi1, diff
|
||||
Repeat
|
||||
phi1 = 1.0 + (1.0 / phi0)
|
||||
diff = Abs(phi1 - phi0)
|
||||
phi0 = phi1
|
||||
iter + 1
|
||||
Until (1.0e-5 > diff)
|
||||
|
||||
PrintN("Using type Double --")
|
||||
PrintN("Result: " + FormatNumber((phi1), 10) + " after " + Str(iter) + " iterations")
|
||||
PrintN("The error is approximately " + FormatNumber((phi1 - (0.5 * (1.0 + Sqr(5.0)))), 10))
|
||||
EndProcedure
|
||||
|
||||
OpenConsole()
|
||||
using_Float()
|
||||
PrintN("")
|
||||
using_Double()
|
||||
Input()
|
||||
CloseConsole()
|
||||
Loading…
Add table
Add a link
Reference in a new issue