Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit a078a38

Browse files
assert_approx_eq! now accepts up to 1e-4
1 parent 71d0edf commit a078a38

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

library/std/tests/floats/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
use std::fmt;
44
use std::ops::{Add, Div, Mul, Rem, Sub};
55

6-
/// Verify that floats are within a tolerance of each other, 1.0e-6 by default.
6+
/// Verify that floats are within a tolerance of each other, 1.0e-4 by default so we do not break test in Miri.
77
macro_rules! assert_approx_eq {
8-
($a:expr, $b:expr) => {{ assert_approx_eq!($a, $b, 1.0e-6) }};
8+
($a:expr, $b:expr) => {{ assert_approx_eq!($a, $b, 1.0e-4) }};
99
($a:expr, $b:expr, $lim:expr) => {{
1010
let (a, b) = (&$a, &$b);
1111
let diff = (*a - *b).abs();

0 commit comments

Comments
 (0)