Commit 42c22de
Merge #47
47: Fix is_multiple_of to account for 0 r=cuviper a=WizardOfMenlo
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.
Co-authored-by: Giacomo Fenzi <[email protected]>
Co-authored-by: Josh Stone <[email protected]>3 files changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
1 | 10 | | |
2 | 11 | | |
3 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
543 | 546 | | |
544 | 547 | | |
545 | 548 | | |
| |||
915 | 918 | | |
916 | 919 | | |
917 | 920 | | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
918 | 924 | | |
919 | 925 | | |
920 | 926 | | |
| |||
1011 | 1017 | | |
1012 | 1018 | | |
1013 | 1019 | | |
| 1020 | + | |
1014 | 1021 | | |
1015 | 1022 | | |
1016 | 1023 | | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
1017 | 1028 | | |
1018 | 1029 | | |
1019 | 1030 | | |
| |||
0 commit comments