-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Fix integer parsing #1614
Fix integer parsing #1614
Conversation
Instead of manually parsing and adding each character to i128::from_str_radix, which is then converted to f64
Now that I think about it, couldn't we use |
Disregard my previous comment, I got confused 😄 but yes, we probably could use BigInt for that, should I look into this? |
Please do! |
It seems to work correctly! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! :D
Test262 conformance changes:
Fixed tests (4):
|
This Pull Request makes it possible to continue with #1602 and also fixes some errors with parsing integers.
It changes the following:
Unanswered questions:- What does the spec say about even larger numbers? I've tested NodeJS and Firefox and you can more or less get unlimited range, albeit anything that's larger thanNumber.MAX_SAFE_INTEGER
is not represented exactly. With this solution, however, numbers get clamped to -1.7e+38 and 1.7e+38. I'm assuming fixing this would most likely require an overhaul of the number representation and parsing code.