views:

90

answers:

1

According to here, arithmetic-shift will bit-shift left and right. The right shift preserves the sign. Is there any unsigned right-shift operator, which fills the vacated bits with zero instead of the sign bit?

+1  A: 

Shift it right by 1 bit, then zero out the sign bit. Then shift it by however many extra bits you need.

Artelius