Skip to content

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>
sygrutenah added a commit to sygrutenah/bigint that referenced this pull request Sep 28, 2025
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>
mrolnie added a commit to mrolnie/numbig that referenced this pull request Sep 28, 2025
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>
tyqiph added a commit to tyqiph/numbig that referenced this pull request Sep 28, 2025
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>
ajit-lee added a commit to ajit-lee/numbig that referenced this pull request Sep 29, 2025
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>
damion-k added a commit to damion-k/numbig that referenced this pull request Sep 29, 2025
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>
pho2288k added a commit to pho2288k/numbig that referenced this pull request Sep 29, 2025
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>
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.

2 participants