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

Function SafeSignedSubtract

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

Source from the content-addressed store, hash-verified

235/// Signed subtraction with well-defined behaviour on overflow (as unsigned)
236template <typename SignedInt>
237SignedInt SafeSignedSubtract(SignedInt u, SignedInt v) {
238 using UnsignedInt = typename std::make_unsigned<SignedInt>::type;
239 return static_cast<SignedInt>(static_cast<UnsignedInt>(u) -
240 static_cast<UnsignedInt>(v));
241}
242
243/// Signed negation with well-defined behaviour on overflow (as unsigned)
244template <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