rotateRightShift method
Returns a bit-wise right-rotation on this
by an r
of bits.
NOTE:
bitWidth
is not validated. See Integral.rotateRightShift.
Implementation
int rotateRightShift(int r, int bitWidth) {
final value = this;
final bitMask = 2.pow(bitWidth) - 1;
final rotation = _maskedRotation(r, bitWidth);
final left = value >> rotation;
final right = (value << (bitWidth - rotation)) & bitMask;
return left | right;
}