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

[BUG] BigInt #744

Open
1 task done
Mercerenies opened this issue Aug 30, 2024 · 1 comment
Open
1 task done

[BUG] BigInt #744

Mercerenies opened this issue Aug 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Mercerenies
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When given a Number argument, BigInt.new truncates to the lowest 32 bits before converting to a BigInt.

Example:

import BigInt;

print(BigInt.new(9999999999).unwrap());

Expected Behavior

I would expect the above code to print 9999999999. Currently, it prints 1410065407 (which is equal to 9999999999 mod (2^32)). If an integer number fits exactly into a double then I would expect it to be convertible to BigInt.

Steps To Reproduce

Tested at e43580d. Run the above code snippet.

Anything else?

No response

@Mercerenies Mercerenies added the bug Something isn't working label Aug 30, 2024
@Jason2605 Jason2605 changed the title [BUG] [BUG] BigInt Nov 8, 2024
@Jason2605
Copy link
Member

Yeah good find! Seems as though I missed this when merging it in, but using the numeric type we are using bigint_from_int which is obviously implicitly converting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants