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
10 * total + code - 0x30 needs to be 10 * 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:
> String.toInt "9007199254740945"
Just 9007199254740944 : Maybe Int
> String.toInt "9007199254740991"
Just 9007199254740992 : Maybe Int
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:
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: