Skip to content

Commit 6a3392f

Browse files
LighghtEelooshepmaster
authored andcommitted
Fix the behavior of negative zero
1 parent b4cf200 commit 6a3392f

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)