lua-users home
lua-l archive

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


On Thu, Aug 04, 2011 at 01:18:10PM +0200, liam mail wrote:
> 
> Please elaborate, giving a cut-and-paste of an interactive session and/or
> a quote from the reference manual and/or an excerpt from the beta source
> code.
> 
> bit32.bnot(0) is 0xFFFFFFFF, which is different from -1 [1]
> 

The bit32 library does not give a C int` or even a C `unsigned`, it gives 
only some routines operating on bit masks.  The mapping from Lua numbers
to 32 bits is not even defined:

> each argument is normalized to the remainder of its division by 2^32 and 
> truncated to an integer (in some unspecified way), so that its final value 
> falls in the range [0,232 - 1].

Dirk