-
Notifications
You must be signed in to change notification settings - Fork 226
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
Right shift gives wrong result #2780
Comments
I was unable to reproduce a runtime or comptime bitshift of So the bug looks to actually be that the prints are out of order when used in a loop in this manner. For example I should always have prints in this format:
but I got this sometimes:
I am going to reproduce the printing issue and make a separate issue for that. |
I don't believe right shifting should cause an overflow with any inputs. If the shift is by 56, then shouldn't it just return 0?
I'll take a look but I would assume this is coming from other parts of the code that depends on wrapping operations If you look at the screenshot, then one of the series of logs is the following
This is wrong since |
Actually, I was wrong. This is considered overflowing behaviour in rust. The test works if I handle the overflowing case separately |
Aim
One of the tests in the noir-bigint library is failing because
0x80000000000000 >> 0x37
(as u56) is evaluating to 0 instead of 1I wasn't able to create a minimal reproducible example but you can check it if you run
This test is failing and the relevant lines of code are here
Expected Behavior
Right shift should be calculated properly
Bug
0x80000000000000 >> 0x37
is evaluating to 0 instead of 1To Reproduce
nargo test --package biguint --show-output test_div3
Installation Method
Binary
Nargo Version
nargo 0.12.0 (git version hash: 7b3df8e, is dirty: false)
Additional Context
No response
Would you like to submit a PR for this Issue?
Maybe
Support Needs
No response
The text was updated successfully, but these errors were encountered: