MCPcopy Create free account
hub / github.com/apache/arrow / SafeSignedSubtract

Function SafeSignedSubtract

cpp/src/arrow/util/int_util_overflow.h:217–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215/// Signed subtraction with well-defined behaviour on overflow (as unsigned)
216template <typename SignedInt>
217SignedInt SafeSignedSubtract(SignedInt u, SignedInt v) {
218 using UnsignedInt = typename std::make_unsigned<SignedInt>::type;
219 return static_cast<SignedInt>(static_cast<UnsignedInt>(u) -
220 static_cast<UnsignedInt>(v));
221}
222
223/// Signed negation with well-defined behaviour on overflow (as unsigned)
224template <typename SignedInt>

Callers 5

basic_decimal.ccFile · 0.85
CallMethod · 0.85
CallMethod · 0.85
CallMethod · 0.85
PutMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected