uint number = 0x418 in bits : 0000010000011000
uint number1 = 0x8041 in bits: 1000000001000001
uint number2 = 0x1804 in bits: 0001100000000100
我无法得到 0x8041
number >> 4;
或者
(number >> 4) & 0xffff;
如何通过移位从 0x418 获得 0x8041 和 0x1804?
解决方案
(number >> nbits) | (number << (16 - nbits))