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

Function SafeLeftShift

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

Source from the content-addressed store, hash-verified

230/// Signed left shift with well-defined behaviour on negative numbers or overflow
231template <typename SignedInt, typename Shift>
232SignedInt SafeLeftShift(SignedInt u, Shift shift) {
233 using UnsignedInt = typename std::make_unsigned<SignedInt>::type;
234 return static_cast<SignedInt>(static_cast<UnsignedInt>(u) << shift);
235}
236
237} // namespace internal
238} // namespace arrow

Callers 3

basic_decimal.ccFile · 0.85
FromBigEndianMethod · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68