[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: NaN in Lua 5.3 Reference Manual
- From: nobody <nobody+lua-list@...>
- Date: Fri, 23 Jun 2017 19:31:32 +0200
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