Home > Software engineering >  How to split high and low byte an integer?
How to split high and low byte an integer?

Time:10-06

An integer (range: 0-9990), 1234 (10011010010), for example,
Into into, byte1 byte2 (11010010) (100)

CodePudding user response:

High=I \ 65536
Low=I mod. 65536

CodePudding user response:

If the byte points, is 256

CodePudding user response:

refer to the original poster ijobxt response:
an integer (range: 0-9990), 1234 (10011010010), for example,
Into into, byte1 byte2 (11010010) (100)


A double-byte integer type

H=a \ 256
L=a mod 256

An array in other way

CodePudding user response:

You take the low byte still use the mod?
L=a And 255
Don't!

CodePudding user response:

Division, yu,

CodePudding user response:

Use the appropriate solution,
Specific look at:
http://zhidao.baidu.com/link? Url=6 sjausm6mdsnp8_ee MW5qjTBeVHjnE9_O3yiHpaiULf4ffWF3vKTpf7B -- eF7dZAY9LqWDVG4O6NApi5lMX5V_
  • Related