Skip to content

Commit d095989

Browse files
authored
Merge pull request #140 from LighghtEeloo/fix-signed-zero
Fix the behavior of negative zero
2 parents b4cf200 + 6a3392f commit d095989

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ impl<'d> Value<'d> {
265265
} else {
266266
"Infinity".to_owned()
267267
}
268+
} else if n == 0.0 {
269+
// Covers both negative and positive zero
270+
"0".to_owned()
268271
} else {
269272
n.to_string()
270273
}

0 commit comments

Comments
 (0)