You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently numeric strings are parsed in an awkward multi-stage fashion by JsonReader -- if there's a decimal point it tries to parse as double, if not then it tries int, if that didn't work then try long, etc. Once that's done, the resulting number is then converted to the target type later in the reading process. This can introduce errors when numbers are out of range (for example there was a long-standing bug where you could not import an unsigned long greater than the maximum -signed- long.)
Ideally numeric strings would only be parsed once we know the numeric type being read, rather than trying to guess from the type from the string format. Not only would this simplify the parsing, it would cut down on the plethora of importers needed for converting between different numeric types.
The text was updated successfully, but these errors were encountered:
Currently numeric strings are parsed in an awkward multi-stage fashion by JsonReader -- if there's a decimal point it tries to parse as double, if not then it tries int, if that didn't work then try long, etc. Once that's done, the resulting number is then converted to the target type later in the reading process. This can introduce errors when numbers are out of range (for example there was a long-standing bug where you could not import an unsigned long greater than the maximum -signed- long.)
Ideally numeric strings would only be parsed once we know the numeric type being read, rather than trying to guess from the type from the string format. Not only would this simplify the parsing, it would cut down on the plethora of importers needed for converting between different numeric types.
The text was updated successfully, but these errors were encountered: