Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
20
Task/Approximate-equality/EasyLang/approximate-equality.easy
Normal file
20
Task/Approximate-equality/EasyLang/approximate-equality.easy
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
func aeq a b .
|
||||
return if abs (a - b) <= abs a * 1e-14
|
||||
.
|
||||
proc test a b . .
|
||||
write a & " " & b & " -> "
|
||||
if aeq a b = 1
|
||||
print "true"
|
||||
else
|
||||
print "false"
|
||||
.
|
||||
.
|
||||
numfmt 10 0
|
||||
test 100000000000000.01 100000000000000.011
|
||||
test 100.01 100.011
|
||||
test 10000000000000.001 / 10000 1000000000.0000001
|
||||
test 0.001 0.0010000001
|
||||
test 1.01e-22 0
|
||||
test sqrt 2 * sqrt 2 2
|
||||
test -sqrt 2 * sqrt 2 -2
|
||||
test 3.14159265358979323846 3.14159265358979324
|
||||
Loading…
Add table
Add a link
Reference in a new issue