SBJson/SBJson

Is there any processing logic related to NaN?

Opened this issue · 1 comments

Is there any processing logic related to NaN?
stig commented

Yes. The writer detects NaNs and errors here:

} else if (isnan([number doubleValue])) {
self.error = @"NaN is not a valid number in JSON";
return NO;
}

For the parser there really is no special handling: there's no way to represent NaN in the JSON grammar, and this parser implements the grammar accurately. Loss of floating-point precision for big numbers is the only issue I am aware of.