Skip to content

Fix is_multiple_of to account for 0 #47

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Apr 29, 2022
Merged

Conversation

WizardOfMenlo
Copy link
Contributor

This pull request fixes the implementation to is_multiple_of to account for the case in which one of the operand is zero. The current implementation panics, while this one currently concludes that 0 is a multiple of 0 (and in fact the only one).

The change is a minimal check, and an inclusion of this edge case in the tests.

@cuviper
Copy link
Member

cuviper commented Apr 29, 2022

Thanks!

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 29, 2022

@bors bors bot merged commit 42c22de into rust-num:master Apr 29, 2022
bors bot added a commit to rust-num/num-bigint that referenced this pull request Feb 11, 2023
240: Fix is_multiple_of with a 0 arg r=cuviper a=cuviper

See also: rust-num/num-integer#47

Co-authored-by: Josh Stone <cuviper@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants