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

Function SafeSignedAdd

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

Source from the content-addressed store, hash-verified

227/// Signed addition with well-defined behaviour on overflow (as unsigned)
228template <typename SignedInt>
229SignedInt SafeSignedAdd(SignedInt u, SignedInt v) {
230 using UnsignedInt = typename std::make_unsigned<SignedInt>::type;
231 return static_cast<SignedInt>(static_cast<UnsignedInt>(u) +
232 static_cast<UnsignedInt>(v));
233}
234
235/// Signed subtraction with well-defined behaviour on overflow (as unsigned)
236template <typename SignedInt>

Callers 1

basic_decimal.ccFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected