diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-09 17:32:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-09 17:32:23 +0200 |
| commit | 542130f72968a1a10caa6ac534720e382f2c9d87 (patch) | |
| tree | 4313dc465aca4ee2eaf45884c3094019ea63bcdc /library | |
| parent | af4cecebd9452f57355194cd9e23a79bc58acb04 (diff) | |
| parent | c4cbb54f3f01b1e2c1927049d04f98d677734c3a (diff) | |
| download | rust-542130f72968a1a10caa6ac534720e382f2c9d87.tar.gz rust-542130f72968a1a10caa6ac534720e382f2c9d87.zip | |
Rollup merge of #146366 - LorrensP-2158466:miri-gamma, r=RalfJung
add approx_delta to all gamma tests f32::gamma tests are less precise in CI, so we increase the tolerance for these tests. See [#miri > Miri test-libstd Failure (2025-09) @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20test-libstd.20Failure.20.282025-09.29/near/538138742) r? `@RalfJung`
Diffstat (limited to 'library')
| -rw-r--r-- | library/std/tests/floats/f32.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/library/std/tests/floats/f32.rs b/library/std/tests/floats/f32.rs index c29d803b25e..3acd0670914 100644 --- a/library/std/tests/floats/f32.rs +++ b/library/std/tests/floats/f32.rs @@ -193,13 +193,13 @@ fn test_atanh() { #[test] fn test_gamma() { // precision can differ between platforms - assert_approx_eq!(1.0f32.gamma(), 1.0f32); - assert_approx_eq!(2.0f32.gamma(), 1.0f32); - assert_approx_eq!(3.0f32.gamma(), 2.0f32); + assert_approx_eq!(1.0f32.gamma(), 1.0f32, APPROX_DELTA); + assert_approx_eq!(2.0f32.gamma(), 1.0f32, APPROX_DELTA); + assert_approx_eq!(3.0f32.gamma(), 2.0f32, APPROX_DELTA); assert_approx_eq!(4.0f32.gamma(), 6.0f32, APPROX_DELTA); assert_approx_eq!(5.0f32.gamma(), 24.0f32, APPROX_DELTA); - assert_approx_eq!(0.5f32.gamma(), consts::PI.sqrt()); - assert_approx_eq!((-0.5f32).gamma(), -2.0 * consts::PI.sqrt()); + assert_approx_eq!(0.5f32.gamma(), consts::PI.sqrt(), APPROX_DELTA); + assert_approx_eq!((-0.5f32).gamma(), -2.0 * consts::PI.sqrt(), APPROX_DELTA); assert_eq!(0.0f32.gamma(), f32::INFINITY); assert_eq!((-0.0f32).gamma(), f32::NEG_INFINITY); assert!((-1.0f32).gamma().is_nan()); |
