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

is_multiple behaviour with 0 #48

Open
WizardOfMenlo opened this issue Feb 9, 2022 · 1 comment
Open

is_multiple behaviour with 0 #48

WizardOfMenlo opened this issue Feb 9, 2022 · 1 comment

Comments

@WizardOfMenlo
Copy link
Contributor

WizardOfMenlo commented Feb 9, 2022

Currently, running BigUint::zero().is_multiple_of(&BigUint::zero()) panics, since the implementation attemps to perform a modular division

*self % *other == 0

However, 0 is indeed a multiple of 0 and as such true should be returned.
Since this is the only edge case, this can be fixed very easily, and I have opened a pull request (#47) accordingly.

@cuviper
Copy link
Member

cuviper commented Mar 21, 2022

BigUint will have to be fixed in its own implementation in the num-bigint crate.

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

No branches or pull requests

2 participants