core: Minor cleanup

This commit is contained in:
Daiki Mizukami 2018-04-24 03:32:40 +09:00
parent fbb1c280bf
commit 104c64dc36

View file

@ -1765,7 +1765,7 @@ assert_eq!((-a).mod_euc(-b), 1);
pub fn mod_euc(self, rhs: Self) -> Self {
let r = self % rhs;
if r < 0 {
if rhs.is_negative() {
if rhs < 0 {
r - rhs
} else {
r + rhs