Skip to content

Commit 9271fda

Browse files
clean up
1 parent e11a804 commit 9271fda

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

library/std/tests/floats/f32.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,7 @@ fn test_log2() {
567567
let nan: f32 = f32::NAN;
568568
let inf: f32 = f32::INFINITY;
569569
let neg_inf: f32 = f32::NEG_INFINITY;
570-
assert_approx_eq!(
571-
10.0f32.log2(),
572-
3.321928 /* Miri float-non-det: Make tests pass for now */
573-
);
570+
assert_approx_eq!(10.0f32.log2(), 3.321928);
574571
assert_approx_eq!(2.3f32.log2(), 1.201634);
575572
assert_approx_eq!(1.0f32.exp().log2(), 1.442695);
576573
assert!(nan.log2().is_nan());

library/std/tests/floats/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fmt;
44
use std::ops::{Add, Div, Mul, Rem, Sub};
55

6-
/// Verify that floats are within a tolerance of each other, 1.0e-4 by default so we do not break test in Miri.
6+
/// Verify that floats are within a tolerance of each other, 1.0e-6 by default.
77
macro_rules! assert_approx_eq {
88
($a:expr, $b:expr) => {{ assert_approx_eq!($a, $b, 1.0e-6) }};
99
($a:expr, $b:expr, $lim:expr) => {{

src/tools/miri/src/intrinsics/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
269269
});
270270
let res = this.adjust_nan(res, &[f]);
271271
this.write_scalar(res, dest)?;
272-
273272
}
273+
274274
#[rustfmt::skip]
275275
| "sinf64"
276276
| "cosf64"
@@ -313,7 +313,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
313313
});
314314
let res = this.adjust_nan(res, &[f]);
315315
this.write_scalar(res, dest)?;
316-
317316
}
318317

319318
"fmaf32" => {
@@ -601,8 +600,7 @@ fn fixed_float_value<S: Semantics>(
601600
("cosf32" | "cosf64", [input]) if input.is_zero() => Some(one),
602601

603602
// e^0 = 1
604-
("expf32" | "expf64" | "exp2f32" | "exp2f64", [input])
605-
if input.is_zero() => Some(one),
603+
("expf32" | "expf64" | "exp2f32" | "exp2f64", [input]) if input.is_zero() => Some(one),
606604

607605
// log(1) = 0
608606
#[rustfmt::skip]

src/tools/miri/tests/pass/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ macro_rules! assert_approx_eq {
3838
}};
3939

4040
($a:expr, $b: expr) => {
41-
// accept up to 52ULP (16ULP for host floats, 4ULP for miri artificial error and 32 for any rounding errors)
41+
// accept up to 32LP (4ULP for miri artificial error and 28ULP for any rounding errors)
4242
assert_approx_eq!($a, $b, 32);
4343
};
4444
}

0 commit comments

Comments
 (0)