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)
| 752 | /// \param length the number of entries in the array |
| 753 | /// \param bits the number of bits to shift (0 <= bits < 32) |
| 754 | static 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. |