Skip to content

Commit 542130f

Browse files
authored
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`
2 parents af4cece + c4cbb54 commit 542130f

File tree

1 file changed

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

1 file changed

+5
-5
lines changed

library/std/tests/floats/f32.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ fn test_atanh() {
193193
#[test]
194194
fn test_gamma() {
195195
// precision can differ between platforms
196-
assert_approx_eq!(1.0f32.gamma(), 1.0f32);
197-
assert_approx_eq!(2.0f32.gamma(), 1.0f32);
198-
assert_approx_eq!(3.0f32.gamma(), 2.0f32);
196+
assert_approx_eq!(1.0f32.gamma(), 1.0f32, APPROX_DELTA);
197+
assert_approx_eq!(2.0f32.gamma(), 1.0f32, APPROX_DELTA);
198+
assert_approx_eq!(3.0f32.gamma(), 2.0f32, APPROX_DELTA);
199199
assert_approx_eq!(4.0f32.gamma(), 6.0f32, APPROX_DELTA);
200200
assert_approx_eq!(5.0f32.gamma(), 24.0f32, APPROX_DELTA);
201-
assert_approx_eq!(0.5f32.gamma(), consts::PI.sqrt());
202-
assert_approx_eq!((-0.5f32).gamma(), -2.0 * consts::PI.sqrt());
201+
assert_approx_eq!(0.5f32.gamma(), consts::PI.sqrt(), APPROX_DELTA);
202+
assert_approx_eq!((-0.5f32).gamma(), -2.0 * consts::PI.sqrt(), APPROX_DELTA);
203203
assert_eq!(0.0f32.gamma(), f32::INFINITY);
204204
assert_eq!((-0.0f32).gamma(), f32::NEG_INFINITY);
205205
assert!((-1.0f32).gamma().is_nan());

0 commit comments

Comments
 (0)