num-integer icon indicating copy to clipboard operation
num-integer copied to clipboard

is_multiple behaviour with 0

Open WizardOfMenlo opened this issue 3 years ago • 1 comments

Currently, running BigUint::zero().is_multiple_of(&BigUint::zero()) panics, since the implementation attemps to perform a modular division https://github.com/rust-num/num-integer/blob/d5267dc842ea730b87cb4610f7ff39adacd81a2f/src/lib.rs#L888 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.

WizardOfMenlo avatar Feb 09 '22 17:02 WizardOfMenlo

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

cuviper avatar Mar 21 '22 20:03 cuviper