[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reading an unaligned integer in little endian (was: Re: Byte endianess v

From: Egeyar Bagcioglu
Subject: Reading an unaligned integer in little endian (was: Re: Byte endianess vs Bit endianess)
Date: Sun, 1 Dec 2019 20:23:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

Hi Jose,

This got stuck in my mind. Can you please check the following two paragraphs below? The first one is what the ios currently does. I wonder if it should do what's described in the second paragraph instead. I cannot imagine the use of the former while I can imagine the latter after John's example. If you also agree that my previous logic was wrong and should be replaced with the second paragraph below, I will do so.

(This is purely about the bit order in little endian. Big endian integers are read fine in all cases.)


On 11/18/19 4:57 PM, egeyar wrote:

For example, if you ask [the ios] to read 11 bits starting from the offset 52, it assumes the bit read at offset 52 is the 7th bit. At offset 53 is the 6th bit. ... At offset 59 is the 0th bit and then at offset 60 is the 10th bit... Lastly, it reads at offset 62 the 8th bit. If you want me to change this logic, I am not sure what to replace it with.

Shall I assume that each byte I read is ordered in itself? Then the same case of reading 11 bits starting from the offset 52 would become the following:
At offset 52 we read the 3rd bit. At offset 53, we read the 2nd... At offset 55 is the bit 0.
At 56 is 10th bit ... and lastly at offset 62 is the bit 4th.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]