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

Method checked_sub

arrow-buffer/src/bigint/mod.rs:374–377  ·  view source on GitHub ↗
(self, other: Self)

Source from the content-addressed store, hash-verified

372 /// Performs checked subtraction
373 #[inline]
374 pub fn checked_sub(self, other: Self) -> Option<Self> {
375 let r = self.wrapping_sub(other);
376 ((other.is_negative() && r > self) || (!other.is_negative() && r <= self)).then_some(r)
377 }
378
379 /// Performs wrapping multiplication
380 #[inline]

Callers 3

test_opsFunction · 0.45
resizeMethod · 0.45
nth_backMethod · 0.45

Calls 2

is_negativeMethod · 0.80
wrapping_subMethod · 0.45

Tested by 1

test_opsFunction · 0.36