-
Notifications
You must be signed in to change notification settings - Fork 290
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 error on large number (> 32bit) #221
Comments
I believe that happens because the library uses the right shift operator to ensure the number is positive: Lines 114 to 116 in 8a3a4bb
In doing so, the value is converted to a 32 bits integer. But 150460469257 is greater than the largest 32-bits integer, signed or unsigned, so I guess it overflows. I don't think I've ever thought of a use for hexadecimal notation beyond representing colors. In such cases 32 bits are sufficient. However, this limitation of the library seems like an unfortunate accident and a bug. |
Thanks for your reply. Perhaps Cheers, |
Wouldn't you say it would be better to use |
I have a solution for this, you need to parse the high and the low part of the number and concatenate. I will push a PR to fix it. |
Hi all,
Firstly, I like to appreciate the author for this lib. Understand it is the most downloaded lib for this function and has been stable for years.
Maybe I missed out something obvious, can someone in the community tell me what happens here:
Thanks.
Cheers,
Paul
The text was updated successfully, but these errors were encountered: