setbits(x, p, n, y)
that returns x
with the
n
bits that begins at position set to the rightmost
n
bit of y
, leaving the other bits unchanged. rightrot(x, n)
that
returns the value of the integer x
rotated to the right by n
bit positions.