1
Fork 0

Fix test floating point comparison to tolerate imprecise FPUs.

This commit is contained in:
Elliott Slaughter 2012-07-24 15:48:18 -07:00
parent 587b0edbbf
commit 1e27d1994f

View file

@ -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;
} }