Skip to content

Commit 66b78d2

Browse files
committed
Tweak f16 and f32 tolerances.
1 parent b3f4720 commit 66b78d2

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

library/std/tests/floats/f16.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,9 @@ fn test_algebraic() {
961961
let a: f16 = 123.0;
962962
let b: f16 = 456.0;
963963

964-
assert_approx_eq!(a.algebraic_add(b), a + b, TOL_0);
965-
assert_approx_eq!(a.algebraic_sub(b), a - b, TOL_0);
966-
assert_approx_eq!(a.algebraic_mul(b), a * b, TOL_0);
967-
assert_approx_eq!(a.algebraic_div(b), a / b, TOL_0);
968-
assert_approx_eq!(a.algebraic_rem(b), a % b, TOL_0);
964+
assert_approx_eq!(a.algebraic_add(b), a + b, 1e1);
965+
assert_approx_eq!(a.algebraic_sub(b), a - b, 1e1);
966+
assert_approx_eq!(a.algebraic_mul(b), a * b, 1e3);
967+
assert_approx_eq!(a.algebraic_div(b), a / b, 1e-2);
968+
assert_approx_eq!(a.algebraic_rem(b), a % b, 1e1);
969969
}

library/std/tests/floats/f32.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -921,9 +921,9 @@ fn test_algebraic() {
921921
let a: f32 = 123.0;
922922
let b: f32 = 456.0;
923923

924-
assert_approx_eq!(a.algebraic_add(b), a + b);
925-
assert_approx_eq!(a.algebraic_sub(b), a - b);
926-
assert_approx_eq!(a.algebraic_mul(b), a * b);
927-
assert_approx_eq!(a.algebraic_div(b), a / b);
928-
assert_approx_eq!(a.algebraic_rem(b), a % b);
924+
assert_approx_eq!(a.algebraic_add(b), a + b, 1e-3);
925+
assert_approx_eq!(a.algebraic_sub(b), a - b, 1e-3);
926+
assert_approx_eq!(a.algebraic_mul(b), a * b, 1e-1);
927+
assert_approx_eq!(a.algebraic_div(b), a / b, 1e-6);
928+
assert_approx_eq!(a.algebraic_rem(b), a % b, 1e-3);
929929
}

0 commit comments

Comments
 (0)