From 5e9d59b0bfc63c1b7b29ca1fefb7c4c1aa1c5a7f Mon Sep 17 00:00:00 2001 From: myyrakle Date: Mon, 15 Jul 2024 23:28:26 +0900 Subject: [PATCH] =?UTF-8?q?[#124]=20float64=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EB=B3=B4=EC=B6=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/float.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/float.rs b/src/utils/float.rs index be2cac9..bfc4b62 100644 --- a/src/utils/float.rs +++ b/src/utils/float.rs @@ -246,5 +246,9 @@ mod tests { let f1 = Float64 { value: 2.0 }; let f2 = Float64 { value: 1.0 }; assert_eq!(Ord::cmp(&f1, &f2), std::cmp::Ordering::Greater); + + let f1 = Float64 { value: f64::NAN }; + let f2 = Float64 { value: f64::NAN }; + assert_eq!(Ord::cmp(&f1, &f2), std::cmp::Ordering::Less); } }