Skip to content

Commit 51a4db1

Browse files
committed
Parse -0 as float -0.0 instead of integer 0
1 parent f5219be commit 51a4db1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/de.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ impl<'de, R: Read<'de>> Deserializer<R> {
434434
} else {
435435
let neg = (significand as i64).wrapping_neg();
436436

437-
// Convert into a float if we underflow.
438-
if neg > 0 {
437+
// Convert into a float if we underflow, or on `-0`.
438+
if neg >= 0 {
439439
ParserNumber::F64(-(significand as f64))
440440
} else {
441441
ParserNumber::I64(neg)

0 commit comments

Comments
 (0)