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

Function ShiftArrayRight

cpp/src/arrow/util/basic_decimal.cc:754–761  ·  view source on GitHub ↗

Shift the number in the array right by bits positions. \param array the number to shift, must have length elements \param length the number of entries in the array \param bits the number of bits to shift (0 <= bits < 32)

Source from the content-addressed store, hash-verified

752/// \param length the number of entries in the array
753/// \param bits the number of bits to shift (0 <= bits < 32)
754static inline void ShiftArrayRight(uint32_t* array, int64_t length, int64_t bits) {
755 if (length > 0 && bits != 0) {
756 for (int64_t i = length - 1; i > 0; --i) {
757 array[i] = (array[i] >> bits) | (array[i - 1] << (32 - bits));
758 }
759 array[0] >>= bits;
760 }
761}
762
763/// \brief Fix the signs of the result and remainder at the end of the division based on
764/// the signs of the dividend and divisor.

Callers 1

DecimalDivideFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected