lua-users home
lua-l archive

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


On 22 April 2013 04:01, KHMan <keinhong@gmail.com> wrote:
> I have a feeling that this has already been addressed in LuaJIT...

LuaJIT defines the semantics in the same way:

http://bitop.luajit.org/semantics.html

"Non-integral numbers may be rounded or truncated in an
implementation-defined way. This means the result could differ between
different BitOp versions, different Lua VMs, on different platforms or
even between interpreted vs. compiled code (as in LuaJIT).
Avoid passing fractional numbers to bitwise functions. Use
math.floor() or math.ceil()to get defined behavior."

    henk