Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/miri
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5c090109931d8206a9f348d35c0eca8cb17397b4
Choose a base ref
..
head repository: rust-lang/miri
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 269a7f56d2516a263c069deba842f6f442d9eb2e
Choose a head ref
Showing with 1 addition and 1 deletion.
  1. +1 −1 tests/pass/float.rs
2 changes: 1 addition & 1 deletion tests/pass/float.rs
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ macro_rules! assert_approx_eq {
// Approximate the ULP by taking half the distance between the number one place "up"
// and the number one place "down".
let ulp = (expected.next_up() - expected.next_down()) / 2.0;
let ulp_diff = ((actual - expected) / ulp).round() as i32;
let ulp_diff = ((actual - expected) / ulp).round().abs() as i32;
if ulp_diff > allowed_ulp_diff {
panic!("{actual:?} is not approximately equal to {expected:?}\ndifference in ULP: {ulp_diff} > {allowed_ulp_diff}");
};