Small and Large Beat Drifting

Will it be:

((0x10203040 >> 24) & 0xFF) == 0x10 

should always be TRUE on machines with small and finite values?

+5
source share
2 answers

Yes. Endianness only affects how bytes are stored in memory. A value of 0x10203040 always 270544960 regardless of whether it is the first or last byte in memory, which is 0x10 .

To take images from Endianness's Wikipedia article for free , regardless of which of these layouts our system uses:

enter image description hereenter image description here

the value 0x0A0B0C0D remains unchanged.

+8
source

will be:

  ((0x10203040 >> 24) & 0xFF) == 0x10 

is always TRUE on machines with small and medium values?

Yes, it will give the same result on both architectures. This is actually a mathematical operation, and MSB LSB orders will be processed under the hood of this particular processor microcode.

+2
source

All Articles