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

Function ShiftArrayLeft

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

Shift the number in the array left 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

739/// \param length the number of entries in the array
740/// \param bits the number of bits to shift (0 <= bits < 32)
741static void ShiftArrayLeft(uint32_t* array, int64_t length, int64_t bits) {
742 if (length > 0 && bits != 0) {
743 for (int64_t i = 0; i < length - 1; ++i) {
744 array[i] = (array[i] << bits) | (array[i + 1] >> (32 - bits));
745 }
746 array[length - 1] <<= bits;
747 }
748}
749
750/// Shift the number in the array right by bits positions.
751/// \param array the number to shift, must have length elements

Callers 1

DecimalDivideFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected