lua-users home
lua-l archive

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


Jeff Wise wrote:
I have had lots of problems with hex constants, probably because my mind is
stuck in the IBM mainframe world. Since 0x'7FFFFFFF is the 32-bit signed
integer representation of the largest possible integer, and if Lua uses
something else (8 byte FLOAT?), then this is a bogus assignment mechanism to
get all ones for a bit comparison/manipulation.

There is nothing wrong with the hex constants, it works fine on Linux and on MinGW, plus print(0xFFFFFFFF) give a correct answer. It's likely a problem with the TOBIT() macro in the bit library sources. I couldn't figure out how the -2147483648 values could have been calculated or produced by visual inspection, or whether the failed bit lib was compiled using the other macro definition for TOBIT(). So at this point, I think we've pretty much exhausted the guessing bit and some debugging is necessary.

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia