Code:
b = 1 << 1 | 1;
use instead:Code:
b = (b << 1) | 1;
to produce 0b00000001 -> 0b00000011 -> 0b00000111 ...or
Code:
b = (b >> 1) | 0x80;
to produce 0b10000000 -> 0b11000000 -> 0b11100000 ...;This is also considerably faster.
dhenry, i have tested what you have said and it doen't work.