Skip to content

Commit

Permalink
Merge pull request #51 from dtolnay/negativenan
Browse files Browse the repository at this point in the history
Add test of negative NaN
  • Loading branch information
dtolnay authored Oct 25, 2023
2 parents b9b01a1 + e6f97e0 commit f84f806
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/d2s_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
3 changes: 2 additions & 1 deletion tests/f2s_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit f84f806

Please sign in to comment.