lua-users home
lua-l archive

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

On Fri, Jan 15, 2010 at 04:38:42PM +0100, Jerome Vuarand wrote:
> I probably don't have a very relevant opinion here, but it would be
> clearer to me to have direction be expressed in terms of msb/lsb
> rather than left/right. In the end the shift input and result are
> numbers, and while I don't know the bit endianness of numbers (and
> AFAICT it's not relevant and neither exposed by the API), msb/lsb on
> the other hand do make sense.

It has nothing to do with endianess in computer systems,
it's related to the big endiannes of our hindu-arabic decimal system.
Most significant digit left (= big end first for those reading left
to right) is how we write numbers in any positional system like hex
and thus we also write four as 100 in binary
and left shift gives 1000 = eight.