Skip to content

Commit 1e27d19

Browse files
author
Elliott Slaughter
committed
Fix test floating point comparison to tolerate imprecise FPUs.
1 parent 587b0ed commit 1e27d19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/run-pass/utf8_idents.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
fn main() {
2+
let ε = 0.00001;
23
let Π = 3.14;
34
let लंच = Π * Π + 1.54;
4-
assert लंच - 1.54 == Π * Π;
5+
assert float::abs((लंच - 1.54) - (Π * Π)) < ε;
56
assert საჭმელად_გემრიელი_სადილი() == 0;
67
}
78

0 commit comments

Comments
 (0)