lua-users home
lua-l archive

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


On 2017-06-23 19:04, John Hind wrote:
Why not given it is a unique bit pattern in the IEEE 754 code space?

It's not, it's **tons** of different patterns.

Which is precisely why it's a problem:  As float, NaN ~= NaN by
definition.  While reinterpreting the bits as int _usually_ (for NaNs
generated by the FPU) gives the same integers, it's not guaranteed to.
Which means no matter how you compare, it may be that NaN ~= NaN, which
makes recalling things from a hash table kinda awkward.

-- nobody