File tree Expand file tree Collapse file tree 1 file changed +6
-30
lines changed Expand file tree Collapse file tree 1 file changed +6
-30
lines changed Original file line number Diff line number Diff line change @@ -2045,22 +2045,14 @@ impl Rem<i32> for BigInt {
2045
2045
2046
2046
#[ inline]
2047
2047
fn rem ( self , other : i32 ) -> BigInt {
2048
- if other >= 0 {
2049
- self % other as u32
2050
- } else {
2051
- self % other. uabs ( )
2052
- }
2048
+ self % other. uabs ( )
2053
2049
}
2054
2050
}
2055
2051
2056
2052
impl RemAssign < i32 > for BigInt {
2057
2053
#[ inline]
2058
2054
fn rem_assign ( & mut self , other : i32 ) {
2059
- if other >= 0 {
2060
- * self %= other as u32 ;
2061
- } else {
2062
- * self %= other. uabs ( ) ;
2063
- }
2055
+ * self %= other. uabs ( ) ;
2064
2056
}
2065
2057
}
2066
2058
@@ -2082,22 +2074,14 @@ impl Rem<i64> for BigInt {
2082
2074
2083
2075
#[ inline]
2084
2076
fn rem ( self , other : i64 ) -> BigInt {
2085
- if other >= 0 {
2086
- self % other as u64
2087
- } else {
2088
- self % other. uabs ( )
2089
- }
2077
+ self % other. uabs ( )
2090
2078
}
2091
2079
}
2092
2080
2093
2081
impl RemAssign < i64 > for BigInt {
2094
2082
#[ inline]
2095
2083
fn rem_assign ( & mut self , other : i64 ) {
2096
- if other >= 0 {
2097
- * self %= other as u64 ;
2098
- } else {
2099
- * self %= other. uabs ( ) ;
2100
- }
2084
+ * self %= other. uabs ( ) ;
2101
2085
}
2102
2086
}
2103
2087
@@ -2119,22 +2103,14 @@ impl Rem<i128> for BigInt {
2119
2103
2120
2104
#[ inline]
2121
2105
fn rem ( self , other : i128 ) -> BigInt {
2122
- if other >= 0 {
2123
- self % other as u128
2124
- } else {
2125
- self % other. uabs ( )
2126
- }
2106
+ self % other. uabs ( )
2127
2107
}
2128
2108
}
2129
2109
2130
2110
impl RemAssign < i128 > for BigInt {
2131
2111
#[ inline]
2132
2112
fn rem_assign ( & mut self , other : i128 ) {
2133
- if other >= 0 {
2134
- * self %= other as u128 ;
2135
- } else {
2136
- * self %= other. uabs ( ) ;
2137
- }
2113
+ * self %= other. uabs ( ) ;
2138
2114
}
2139
2115
}
2140
2116
You can’t perform that action at this time.
0 commit comments