From 6a3392fe029f8847f23662f68601a555411c3522 Mon Sep 17 00:00:00 2001 From: LighghtEeloo Date: Thu, 24 Feb 2022 18:51:20 -0500 Subject: [PATCH] Fix the behavior of negative zero --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 11e5afeb..2f62faa6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -265,6 +265,9 @@ impl<'d> Value<'d> { } else { "Infinity".to_owned() } + } else if n == 0.0 { + // Covers both negative and positive zero + "0".to_owned() } else { n.to_string() }