开发者

How to do bit-wise zero-filling right shift in Scheme?

开发者 https://www.devze.com 2022-12-10 06:36 出处:网络
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 ze

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消