MCPcopy Create free account
hub / github.com/apache/arrow-rs / wrapping_abs

Method wrapping_abs

arrow-buffer/src/bigint/mod.rs:322–329  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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]

Callers 4

checked_absMethod · 0.45
checked_mulMethod · 0.45
div_remMethod · 0.45
absMethod · 0.45

Calls 1

wrapping_subMethod · 0.45

Tested by

no test coverage detected