Skip to content

Commit cdc2f1c

Browse files
fix uncaught crashes
1 parent 7b99282 commit cdc2f1c

File tree

1 file changed

+2
-2
lines changed
  • library/std/tests/floats

1 file changed

+2
-2
lines changed

library/std/tests/floats/f32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn test_log() {
7979
let nan: f32 = f32::NAN;
8080
let inf: f32 = f32::INFINITY;
8181
let neg_inf: f32 = f32::NEG_INFINITY;
82-
assert_approx_eq!(10.0f32.log(10.0), 1.0);
82+
assert_approx_eq!(10.0f32.log(10.0), 1.0, APPROX_DELTA);
8383
assert_approx_eq!(2.3f32.log(3.5), 0.664858);
8484
assert_approx_eq!(1.0f32.exp().log(1.0f32.exp()), 1.0, APPROX_DELTA);
8585
assert!(1.0f32.log(1.0).is_nan());
@@ -218,7 +218,7 @@ fn test_ln_gamma() {
218218
assert_eq!(2.0f32.ln_gamma().1, 1);
219219
assert_approx_eq!(3.0f32.ln_gamma().0, 2.0f32.ln());
220220
assert_eq!(3.0f32.ln_gamma().1, 1);
221-
assert_approx_eq!((-0.5f32).ln_gamma().0, (2.0 * consts::PI.sqrt()).ln());
221+
assert_approx_eq!((-0.5f32).ln_gamma().0, (2.0 * consts::PI.sqrt()).ln(), APPROX_DELTA);
222222
assert_eq!((-0.5f32).ln_gamma().1, -1);
223223
}
224224

0 commit comments

Comments
 (0)