rust/src/test/ui/format-nan.rs
2019-07-27 18:56:16 +03:00

10 lines
216 B
Rust

// run-pass
pub fn main() {
use std::f64;
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);
}