lua-users home
lua-l archive

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


Rene Rebe <rene@exactcode.de> writes:
> No. But given that Lua (reasonably) defaults to double I expect to be
> able to use them reasonably. And not to trap into a surprising result
> in every line:
>
> -- lua-5.2(work1)
> = bit.band(0xffff / 256, 0xff)
> 255

There are better ways to write that, and you should use them...
expecting fractions to silently be dropped is just plain dodgy.

[e.g., = bit.band (bit.rshift (0xffff, 8), 0xff) ]

-Miles

-- 
Resign, v. A good thing to do when you are going to be kicked out.