Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
16
Task/Approximate-equality/Pluto/approximate-equality.pluto
Normal file
16
Task/Approximate-equality/Pluto/approximate-equality.pluto
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
local tol = 1e-16
|
||||
local sqrt2 = math.sqrt(2.0)
|
||||
local pairs = {
|
||||
{100000000000000.01, 100000000000000.011},
|
||||
{100.01, 100.011},
|
||||
{10000000000000.001 / 10000.0, 1000000000.0000001000},
|
||||
{0.001, 0.0010000001},
|
||||
{0.000000000000000000000101, 0.0},
|
||||
{sqrt2 * sqrt2, 2.0},
|
||||
{-sqrt2 * sqrt2, -2.0},
|
||||
{3.14159265358979323846, 3.14159265358979324}
|
||||
}
|
||||
print($"Approximate equality of test cases for a tolerance of {tol}:")
|
||||
for i, pair in pairs do
|
||||
print($" {i} -> {math.abs(pair[1] - pair[2]) < tol}")
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue