rust/library/core/tests/num/nan.rs

8 lines
193 B
Rust
Raw Normal View History

2020-10-27 01:29:57 +01:00
#[test]
fn test_nan() {
2020-11-05 00:40:04 +01:00
let x = "NaN".to_string();
assert_eq!(format!("{}", f64::NAN), x);
assert_eq!(format!("{:e}", f64::NAN), x);
assert_eq!(format!("{:E}", f64::NAN), x);
2020-10-27 01:29:57 +01:00
}