Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance: clean up use of numeric exporters and importers #6

Open
BBI-YggyKing opened this issue May 21, 2014 · 0 comments
Open

Comments

@BBI-YggyKing
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants