Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
#include "string.bi"
|
||||
|
||||
Dim Shared As Double epsilon = 1
|
||||
|
||||
Sub eq_approx(a As Double,b As Double)
|
||||
Dim As Boolean tmp = Abs(a - b) < epsilon
|
||||
Print Using "& & &";tmp;a;b
|
||||
End Sub
|
||||
|
||||
While (1 + epsilon <> 1)
|
||||
epsilon /= 2
|
||||
Wend
|
||||
|
||||
Print "epsilon = "; Format(epsilon, "0.000000000000000e-00")
|
||||
Print
|
||||
eq_approx(100000000000000.01, 100000000000000.011)
|
||||
eq_approx(100.01, 100.011)
|
||||
eq_approx(10000000000000.001/10000.0, 1000000000.0000001000)
|
||||
eq_approx(0.001, 0.0010000001)
|
||||
eq_approx(0.000000000000000000000101, 0.0)
|
||||
eq_approx(Sqr(2)*Sqr(2), 2.0)
|
||||
eq_approx(-Sqr(2)*Sqr(2), -2.0)
|
||||
eq_approx(3.14159265358979323846, 3.14159265358979324)
|
||||
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue