We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b419f2e + 51a4db1 commit d86e353Copy full SHA for d86e353
src/de.rs
@@ -434,8 +434,8 @@ impl<'de, R: Read<'de>> Deserializer<R> {
434
} else {
435
let neg = (significand as i64).wrapping_neg();
436
437
- // Convert into a float if we underflow.
438
- if neg > 0 {
+ // Convert into a float if we underflow, or on `-0`.
+ if neg >= 0 {
439
ParserNumber::F64(-(significand as f64))
440
441
ParserNumber::I64(neg)
tests/test.rs
@@ -805,6 +805,7 @@ fn test_parse_u64() {
805
#[test]
806
fn test_parse_negative_zero() {
807
for negative_zero in &[
808
+ "-0",
809
"-0.0",
810
"-0e2",
811
"-0.0e2",
0 commit comments