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

Method Call

cpp/src/arrow/compute/kernels/scalar_arithmetic.cc:136–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134struct ShiftRight {
135 template <typename T, typename Arg0, typename Arg1>
136 static T Call(KernelContext*, Arg0 lhs, Arg1 rhs, Status*) {
137 static_assert(std::is_same<T, Arg0>::value, "");
138 // Logical right shift when Arg0 is unsigned
139 // Arithmetic otherwise (this is implementation-defined but GCC and MSVC document this
140 // as arithmetic right shift)
141 // https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html#Integers-implementation
142 // https://docs.microsoft.com/en-us/cpp/cpp/left-shift-and-right-shift-operators-input-and-output?view=msvc-160
143 // Clang doesn't document their behavior.
144 if (ARROW_PREDICT_FALSE(rhs < 0 || rhs >= std::numeric_limits<Arg0>::digits)) {
145 return lhs;
146 }
147 return lhs >> rhs;
148 }
149};
150
151struct ShiftRightChecked {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected