Rotate left
Posted: Thu Nov 12, 2015 5:04 pm
Is there a C-code for rotate left and rotate right?
For users to discuss using Matrix products.
https://matrixtsl.com/mmforums/
Code: Select all
var = var >> 1;
Code: Select all
count = 0;
while (count < shiftcount)
{
bitsave = var & 0x01;
var = var >> 1;
if (bitsave == 0x01)
var = var | 0x80;
count = count + 1;
}
Code: Select all
count = 0;
while (count < shiftcount)
{
bitsave = var & 0x80;
var = var << 1;
if (bitsave == 0x80)
var = var | 0x01;
count = count + 1;
}