lua-users home
lua-l archive

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


Sorry for the late reply, but I have one question on the bit32
library:

The library provides the following shift operators:

arshift - arithmetic shift (+right -left )
lrotate - rotate left      (+left  -right)
lshift  - shift left       (+left  -right)
rrotate - rotate right     (+right -left)
rshift  - shift right      (+right -left)

It seems to me that really only three operators needed, and the
implied direction of the shift value should be consistent across
all three, like this:

ashift - arithmetic shift (+right -left )
rotate - rotate           (+right -left)
lshift - logical shift    (+right -left)

If it's "baked in" at this point, then so be it. It's too bad that
something as "simple" as a bit library gets this much attention :-)

Ralph