Skip to content

Commit aec3114

Browse files
committed
x86/rounding-error test: add a bit of slack
1 parent fb6a453 commit aec3114

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/pass/shims/x86/rounding-error.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ fn main() {
2626
let rel_error = (r - exact) / exact;
2727
let log_error = rel_error.abs().log2();
2828
assert!(
29-
rel_error == 0.0 || log_error < -12.0,
30-
"got an error of {rel_error} = 2^{log_error}"
29+
// Add a bit of slack since our log_error compuation gets rounded itself.
30+
rel_error == 0.0 || log_error < -12.0 + 1e-5,
31+
"correct result: {exact}, got: {r}\n\
32+
that's an error of {rel_error} = 2^{log_error}"
3133
);
3234
}
3335
}

0 commit comments

Comments
 (0)