lua-users home
lua-l archive

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


On Fri, Nov 5, 2021 at 3:32 PM Philippe Verdy <verdyp@gmail.com> wrote:
Le ven. 5 nov. 2021 à 18:04, Ranier Vilela <ranier.vf@gmail.com> a écrit :
 although 63-bit integers are possible by using the sign bit of the NaN to distinguish them, and the loss of one bit from a 64-bit integer is not likely to be a problem for the majority of applications.
That's an incomplete (or false) statement:

Yeah, thanks for the correction. I was thinking too fast while distracted.

Realistically, NaN packing is best for languages without a separate integer type anyway, such as Lua 5.2 and earlier. As soon as you introduce an integer type, you have to either cap it at 50-something bits (which is a strange limitation to have in your language) or treat it as an object via a pointer (not great for performance), and either way is awkward.