diff --git a/tests/d2s_test.rs b/tests/d2s_test.rs index 368cab6..7e8eba6 100644 --- a/tests/d2s_test.rs +++ b/tests/d2s_test.rs @@ -82,7 +82,8 @@ fn test_basic() { check!(-0.0); check!(1.0); check!(-1.0); - assert_eq!(pretty(f64::NAN), "NaN"); + assert_eq!(pretty(f64::NAN.copysign(1.0)), "NaN"); + assert_eq!(pretty(f64::NAN.copysign(-1.0)), "NaN"); assert_eq!(pretty(f64::INFINITY), "inf"); assert_eq!(pretty(f64::NEG_INFINITY), "-inf"); } diff --git a/tests/f2s_test.rs b/tests/f2s_test.rs index 927fa7e..d6249a3 100644 --- a/tests/f2s_test.rs +++ b/tests/f2s_test.rs @@ -75,7 +75,8 @@ fn test_basic() { check!(-0.0); check!(1.0); check!(-1.0); - assert_eq!(pretty(f32::NAN), "NaN"); + assert_eq!(pretty(f32::NAN.copysign(1.0)), "NaN"); + assert_eq!(pretty(f32::NAN.copysign(-1.0)), "NaN"); assert_eq!(pretty(f32::INFINITY), "inf"); assert_eq!(pretty(f32::NEG_INFINITY), "-inf"); }