Closed
Description
i8::MIN.next_multiple_of(-1)
should return -128 (i8::MIN
), but instead panics. The fix for this is to add if self == -1 { return self; }
at the top of the method.
I have not checked, but it is certainly worth checking whether a similar situation applies with prev_multiple_of
.
This is the only issue with the current implementation of next_multiple_of
. It otherwise works as expected.
Metadata
Metadata
Assignees
Labels
No labels