rotateLeft

rot shift to the left

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

Parameters

x
Type: T

integer to shift

shiftAmount
Type: uint

number of bits to shift

Examples

test rotateLeft

1 t {
2 	ubyte b0 = 0b10000001;
3 	ubyte b1 = 0b00000011;
4 	ubyte b2 = 0b00000110;
5 	ubyte b7 = 0b11000000;
6 	
7 	assert(rotateLeft(b0,0) == b0);
8 	assert(rotateLeft(b0,1) == b1);
9 	assert(rotateLeft(b0,2) == b2);
10 	assert(rotateLeft(b0,7) == b7);
11 	assert(rotateLeft(b0,8) == b0

Meta