A bit manipulation readability enhancement library.
Performs a bitwise right rotation on a number.
public static sbyte RotateRight(this sbyte number, int count);
number
System.SByte
The number to rotate
count
System.Int32
the number of bits to rotate
System.SByte The rotated value.
Examples
byte ub = 0b11110000;
sbyte b = (sbyte)b;
var b2 = b.RotateRight(3); // b2 = 0b00011110
var b3 = b.RotateRight(4); // b3 = 0b00001111
var b4 = b.RotateRight(5); // b4 = 0b10000111
var b5 = b.RotateRight(6); // b5 = 0b11000011
var b6 = b.RotateRight(7); // b6 = 0b11100001
var b7 = b.RotateRight(8); // b7 = 0b11110000