[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: the purpose of lightuserdata
- From: Mike Pall <mikelu-1101@...>
- Date: Tue, 11 Jan 2011 13:21:28 +0100
David Manura wrote:
> (Additional caveat: in LuaJIT the upper "NaN" bits of 64-bit
> Value's are reserved for special purposes, and this limitation likely
> prohibits using all bits of 64-bit lightuserdata's.)
Yes, and (ab)using lightuserdata for 64 bit arithmetic is mixing
concerns. It wouldn't work on a 32 bit platform, anyway.
LuaJIT git HEAD already has 64 bit literals and arithmetic:
$ luajit -e "print(123456789123456789LL + 987654321987654321LL)"
$ luajit -e "print(10LL ^ 18)"
[Support is still incomplete. Comparisons and bit operations are
missing and not all compiler backends allow 64 bit arithmetic, yet.
Ditto for complex literals: print(12.5i) works, but not much else.
Will take me a couple more days/weeks to finish all of that.]