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

Function SafeSignedNegate

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

Source from the content-addressed store, hash-verified

243/// Signed negation with well-defined behaviour on overflow (as unsigned)
244template <typename SignedInt>
245SignedInt SafeSignedNegate(SignedInt u) {
246 using UnsignedInt = typename std::make_unsigned<SignedInt>::type;
247 return static_cast<SignedInt>(~static_cast<UnsignedInt>(u) + 1);
248}
249
250/// Signed left shift with well-defined behaviour on negative numbers or overflow
251template <typename SignedInt, typename Shift>

Callers 4

basic_decimal.ccFile · 0.85
TESTFunction · 0.85
CallMethod · 0.85
CallMethod · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68