Editions Ideas
Walter Bright
newshound2 at digitalmars.com
Sun Dec 14 20:32:03 UTC 2025
On 12/14/2025 5:27 AM, Dom Disc wrote:
>> IEEE754 compliance is both expected and baked into the CPU hardware.
>
> Yup. But it only requires NaN == 0 to be false. It doesn't talk about NaN != 0
> at all.
Googling NaN and IEEE754 will produce an explanation of this, since you don't
believe me :-) The explanation is NaN is never equal to anything, so NaN!=0 is true.
I implemented NaN behavior in the 1980s, and was very scrupulous in doing it
exactly according to the spec, regardless of what I thought would be better. If
I had done it differently, I would have been subject to endless complaints.
More information about the Digitalmars-d
mailing list