Skip to content

Commit 557f172

Browse files
some cleanup
1 parent b008024 commit 557f172

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
@@ -572,9 +572,17 @@ fn test_log2() {
572572
let nan: f32 = f32::NAN;
573573
let inf: f32 = f32::INFINITY;
574574
let neg_inf: f32 = f32::NEG_INFINITY;
575-
assert_approx_eq!(10.0f32.log2(), 3.321928, APPROX_DELTA);
575+
assert_approx_eq!(
576+
10.0f32.log2(),
577+
3.321928,
578+
APPROX_DELTA /* Miri float-non-det: Make tests pass for now */
579+
);
576580
assert_approx_eq!(2.3f32.log2(), 1.201634);
577-
assert_approx_eq!(1.0f32.exp().log2(), 1.442695, APPROX_DELTA);
581+
assert_approx_eq!(
582+
1.0f32.exp().log2(),
583+
1.442695,
584+
APPROX_DELTA /* Miri float-non-det: Make tests pass for now */
585+
);
578586
assert!(nan.log2().is_nan());
579587
assert_eq!(inf.log2(), inf);
580588
assert!(neg_inf.log2().is_nan());
@@ -767,7 +775,11 @@ fn test_real_consts() {
767775
assert_approx_eq!(log2_e, e.log2());
768776
assert_approx_eq!(log10_e, e.log10());
769777
assert_approx_eq!(ln_2, 2f32.ln());
770-
assert_approx_eq!(ln_10, 10f32.ln(), APPROX_DELTA);
778+
assert_approx_eq!(
779+
ln_10,
780+
10f32.ln(),
781+
APPROX_DELTA /* Miri float-non-det: Make tests pass for now */
782+
);
771783
}
772784

773785
#[test]

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

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

0 commit comments

Comments
 (0)