lua-users home
lua-l archive

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


I like BitOp's naming convention, which uses bit.bnot, bit.band, bit.bor, and bit.bxor for the bitwise logical operations, but uses bit.shift and bit.rot (well, rol and ror, which I side with 5.2 as being redundant in favor of negative operands).

Also, just to confirm, the 5.2 manual states to use arithmetic operators for arithmetic shifting. That means

function arshift(value, bits)
   return value/(2^bits)
end

correct?