(self)
| 320 | /// Computes the absolute value of this i256 |
| 321 | #[inline] |
| 322 | pub fn wrapping_abs(self) -> Self { |
| 323 | // -1 if negative, otherwise 0 |
| 324 | let sa = self.high >> 127; |
| 325 | let sa = Self::from_parts(sa as u128, sa); |
| 326 | |
| 327 | // Inverted if negative |
| 328 | Self::from_parts(self.low ^ sa.low, self.high ^ sa.high).wrapping_sub(sa) |
| 329 | } |
| 330 | |
| 331 | /// Computes the absolute value of this i256 returning `None` if `Self == Self::MIN` |
| 332 | #[inline] |
no test coverage detected