Skip to content

Fix is_multiple_of to account for 0 - #47

Merged
bors[bot] merged 4 commits into
rust-num:masterfrom
WizardOfMenlo:master
Apr 29, 2022
Merged

Fix is_multiple_of to account for 0#47
bors[bot] merged 4 commits into
rust-num:masterfrom
WizardOfMenlo:master

Conversation

@WizardOfMenlo

Copy link
Copy Markdown
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.

Comment threadsrc/lib.rs
@cuviper

Copy link
Copy Markdown
Member

Thanks!

bors r+

@bors

borsBot commented Apr 29, 2022

Copy link
Copy Markdown
Contributor

@bors
borsBot merged commit 42c22de into rust-num:masterApr 29, 2022
borsBot 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>
Sign up for freeto 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

@WizardOfMenlo@cuviper