Skip to content

Commit 20cf8ca

Browse files
committed
float tests: use assert_biteq in more places
1 parent b6685d7 commit 20cf8ca

File tree

5 files changed

+224
-215
lines changed

5 files changed

+224
-215
lines changed

library/coretests/tests/floats/f128.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ use core::ops::{Add, Div, Mul, Sub};
55
use std::f128::consts;
66
use std::num::FpCategory as Fp;
77

8+
use super::{assert_approx_eq, assert_biteq};
9+
810
// Note these tolerances make sense around zero, but not for more extreme exponents.
911

1012
/// Default tolerances. Works for values that should be near precise but not exact. Roughly

library/coretests/tests/floats/f16.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
use std::f16::consts;
55
use std::num::FpCategory as Fp;
66

7+
use super::{assert_approx_eq, assert_biteq};
8+
79
/// Tolerance for results on the order of 10.0e-2
810
#[allow(unused)]
911
const TOL_N2: f16 = 0.0001;

library/coretests/tests/floats/f32.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use core::f32;
22
use core::f32::consts;
33
use core::num::FpCategory as Fp;
44

5+
use super::{assert_approx_eq, assert_biteq};
6+
57
/// Smallest number
68
const TINY_BITS: u32 = 0x1;
79

library/coretests/tests/floats/f64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use core::f64;
22
use core::f64::consts;
33
use core::num::FpCategory as Fp;
44

5+
use super::{assert_approx_eq, assert_biteq};
6+
57
/// Smallest number
68
const TINY_BITS: u64 = 0x1;
79

0 commit comments

Comments
 (0)