Hello everyone,
I was just wondering if someone could help me figure out how to write a function that rotates bits in
Java while carrying over. For example, if I had :
int
test = 0x41; //00000000000000000000000001000001 <-- 65
and I wanted to rotate to the right by 3( could be any number, just an example), then I want the number to turn out to:
00100000000000000000000000001000 <-- 536870920
Using the bit shift operators fills the variable with zeroes when the ones fall off. Any help would be greatly appreciated!