-
Notifications
You must be signed in to change notification settings - Fork 3
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
Shift right would overflow #4
Comments
Can I jsut use a wrapping_shr on the usize value or will this differ from the intended semantics? |
Looks like (u64::wrapping_mul(
(occupied & ROOK_MAGICS.masks[s.0 as usize]).0,
ROOK_MAGICS.magics[s.0 as usize]
) >> (64-12)) as usize |
Yes, this looks like a bug, and @niklasf 's fix seems correct. |
Thank you both! I have forked the repo and created a pull request. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am getting the following errors in the bitboard module while compiling the source code:
![image](https://user-images.githubusercontent.com/5702543/100222336-3af93d80-2f1a-11eb-97b9-ccddb92041e7.png)
The code affected by these errors is the following:
Do you know why this error occurs or what I can do to fix the overflow?
The text was updated successfully, but these errors were encountered: