lua-users home
lua-l archive

Re: the purpose of lightuserdata

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


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)"
1111111111111111110LL
$ luajit -e "print(10LL ^ 18)"
1000000000000000000LL
[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.]
--Mike

AltStyle によって変換されたページ (->オリジナル) /