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

Number fixes #89

Closed
wants to merge 2 commits into from
Closed

Number fixes #89

wants to merge 2 commits into from

Conversation

Kan18
Copy link
Contributor

@Kan18 Kan18 commented Oct 6, 2024

Fixes #88. I decided to keep the Lua 5.3 behavior that hexadecimal numbers without a radix point or exponent wrap-around (which was already the current Cobalt behavior) so that it wouldn't need to be changed again whenever Cobalt updates to Lua 5.3.
Also fixes another bug I found where 2^63 had its last digit incorrectly displaying as 7 instead of 8. This was happening because Math.pow(2, 63) == (long)Math.pow(2, 63): the long was getting converted to a double in the comparison here, making both equal, even though (long)Math.pow(2, 63) is 9223372036854775807 and Math.pow(2, 63) is 9223372036854775808.

@SquidDev
Copy link
Member

Thank for the fix! I'm afraid I've gone for a slightly different approach in fb0f323, which should match what PUC Lua 5.2 does a little more closely.

@SquidDev SquidDev closed this Oct 25, 2024
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

Successfully merging this pull request may close these issues.

Integers being parsed into long results in inconsistencies
2 participants