-
Notifications
You must be signed in to change notification settings - Fork 361
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
Overflow issue when converting integers near maxint #1142
Comments
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
10 * total + code - 0x30
needs to be10 * total + (code - 0x30)
, otherwise this overflows the integer range when converting values close to maxint (2^53 - 1 = 9007199254740991 with a JS backend). For example:https://github.com/elm/core/blob/84f38891468e8e153fc85a9b63bdafd81b24664e/src/Elm/Kernel/String.js#L291C24-L291C35
I would expect this function to always give an exact result whenever the integer literal fits into the available range for integers, but this is currently not true.
The text was updated successfully, but these errors were encountered: