summaryrefslogtreecommitdiffstats
path: root/library/core/tests/num/nan.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/tests/num/nan.rs')
-rw-r--r--library/core/tests/num/nan.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/core/tests/num/nan.rs b/library/core/tests/num/nan.rs
new file mode 100644
index 000000000..ef81988c9
--- /dev/null
+++ b/library/core/tests/num/nan.rs
@@ -0,0 +1,7 @@
+#[test]
+fn test_nan() {
+ 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);
+}