Could someone explain me why:
x = x << 1; x = x >> 1;
and:
x = (x << 1) >> 1;
pr
When you bitshift the result is promoted to int. In the first example you convert int back to uint8_t everytime, and lose the intermediate data. But in the second example you keep the int result when you shift back.
int