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

Conversion from int does not respect the JS safe range as documented #8

Open
okkero opened this issue May 11, 2023 · 0 comments
Open

Comments

@okkero
Copy link

okkero commented May 11, 2023

I am having some trouble working with this library. Conversion from int seems to break down for large numbers, even when the number is within the JS safe range.

Take a look at the following code: https://ellie-app.com/mMqXP4NnLsNa1
The value given to all of those operations is lower than MAX_SAFE_INTEGER, but the result is still not what was put in when going back to string through Int64.

The documentation for Int64.fromInt says it is guaranteed to work for integers in the safe JS range. Yet, this is not the behavior I'm seeing.

Or maybe toSignedString and/or toUnsignedString are broken? I don't know.

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

No branches or pull requests

1 participant