Skip to content
Browse files

Retain the sign when parsing -0.0

  • Loading branch information...
1 parent d863525 commit 7f4edf469b64c515684a3891fbc1432a285731ff @stig committed Sep 26, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 Classes/SBJsonTokeniser.m
  2. +1 −1 Tests/Data/valid/number/float/output
View
2 Classes/SBJsonTokeniser.m
@@ -368,7 +368,7 @@ - (sbjson_token_t)getNumberToken:(NSObject**)token {
if (!isFloat && !hasExponent) {
*token = [NSNumber numberWithLongLong: isNegative ? -mantissa : mantissa];
} else if (mantissa == 0) {
- *token = [NSNumber numberWithInt:0];
+ *token = [NSNumber numberWithFloat:-0.0f];
} else {
*token = [NSDecimalNumber decimalNumberWithMantissa:mantissa
exponent:exponent
View
2 Tests/Data/valid/number/float/output
@@ -1 +1 @@
-[0.0001,2.5,4.4,99.99,720.17300000000000182,0]
+[0.0001,2.5,4.4,99.99,720.17300000000000182,-0]

0 comments on commit 7f4edf4

Please sign in to comment.
Something went wrong with that request. Please try again.