rotateRight

rot shift to the right

@safe @nogc pure nothrow
T
rotateRight
(
T
)
(
T x
,)

Parameters

x T

integer to shift

shiftAmount uint

number of bits to shift

Examples

test rotateRight

t {
	ubyte b0 = 0b00000101;
	ubyte b1 = 0b10000010;
	ubyte b2 = 0b01000001;
	ubyte b7 = 0b00001010;
	
	assert(rotateRight(b0,0) == b0);
	assert(rotateRight(b0,1) == b1);
	assert(rotateRight(b0,2) == b2);
	assert(rotateRight(b0,7) == b7);
	assert(rotateRight(b0,8) == b0

Meta