Skip to content

Commit b1b9abf

Browse files
some cleanup
1 parent f7579a1 commit b1b9abf

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

library/std/tests/floats/f32.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,17 @@ fn test_log2() {
539539
let nan: f32 = f32::NAN;
540540
let inf: f32 = f32::INFINITY;
541541
let neg_inf: f32 = f32::NEG_INFINITY;
542-
assert_approx_eq!(10.0f32.log2(), 3.321928, APPROX_DELTA);
542+
assert_approx_eq!(
543+
10.0f32.log2(),
544+
3.321928,
545+
APPROX_DELTA /* Miri float-non-det: Make tests pass for now */
546+
);
543547
assert_approx_eq!(2.3f32.log2(), 1.201634);
544-
assert_approx_eq!(1.0f32.exp().log2(), 1.442695, APPROX_DELTA);
548+
assert_approx_eq!(
549+
1.0f32.exp().log2(),
550+
1.442695,
551+
APPROX_DELTA /* Miri float-non-det: Make tests pass for now */
552+
);
545553
assert!(nan.log2().is_nan());
546554
assert_eq!(inf.log2(), inf);
547555
assert!(neg_inf.log2().is_nan());
@@ -704,5 +712,9 @@ fn test_real_consts() {
704712
assert_approx_eq!(log2_e, e.log2());
705713
assert_approx_eq!(log10_e, e.log10());
706714
assert_approx_eq!(ln_2, 2f32.ln());
707-
assert_approx_eq!(ln_10, 10f32.ln(), APPROX_DELTA);
715+
assert_approx_eq!(
716+
ln_10,
717+
10f32.ln(),
718+
APPROX_DELTA /* Miri float-non-det: Make tests pass for now */
719+
);
708720
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ macro_rules! assert_approx_eq {
5151
/// s | 1111 1111 | 0x..x
5252
/// ````
5353
/// Were at least one `x` is a 1.
54-
///
54+
///
5555
/// This sNaN has the following representation and is used for testing purposes.:
5656
/// ```
5757
/// 0 | 1111111 | 01..0

0 commit comments

Comments
 (0)