According to here, arithmetic-shift
will bit-shift left and right. The right shift preserves the sign. Is there any unsigned right-shift operato开发者_如何学编程r, which fills the vacated bits with zero instead of the sign bit?
Shift it right by 1 bit, then zero out the sign bit. Then shift it by however many extra bits you need.
精彩评论