Fix test floating point comparison to tolerate imprecise FPUs.
This commit is contained in:
parent
587b0edbbf
commit
1e27d1994f
1 changed files with 2 additions and 1 deletions
|
@ -1,7 +1,8 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let ε = 0.00001;
|
||||||
let Π = 3.14;
|
let Π = 3.14;
|
||||||
let लंच = Π * Π + 1.54;
|
let लंच = Π * Π + 1.54;
|
||||||
assert लंच - 1.54 == Π * Π;
|
assert float::abs((लंच - 1.54) - (Π * Π)) < ε;
|
||||||
assert საჭმელად_გემრიელი_სადილი() == 0;
|
assert საჭმელად_გემრიელი_სადილი() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue