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

Fix shl and shr #134

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Fix shl and shr #134

merged 2 commits into from
Jul 28, 2023

Conversation

konsumlamm
Copy link
Contributor

shl could create invalid zero values, by shifting 0.

shr could raise an exception when the shift is too big.

Copy link
Contributor

@dlesnoff dlesnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nicer, but I would avoid a few computations in this edge case.

src/bigints.nim Show resolved Hide resolved
Copy link
Contributor

@dlesnoff dlesnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@konsumlamm
Copy link
Contributor Author

@narimiran can this be merged?

@narimiran narimiran merged commit 38eb846 into nim-lang:master Jul 28, 2023
4 checks passed
@konsumlamm konsumlamm deleted the shift branch July 28, 2023 19:29
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.

3 participants