[cfp-interest 3898] Re: convertFrom and signaling NaNs
Damian McGuckin
damianm at esi.com.au
Fri Apr 17 18:53:04 PDT 2026
On Thu, 16 Apr 2026, RAJAN BHAKTA wrote:
> I was giving a specific case of value, but the general case I believe holds:
> The value of a NaN (signaling or otherwise) is a NaN (not a number).
Correct. When it comes to their "value", all you can say is that the value
of a NaN does not compare equal to itself. That is not to say that the
bit-by-bit representation of a NaN does not compare equal to itself. And
likewise, the payloads of an sNaN and a qNaN may be identical. And
likewise, the 'totalOrder()' operation is defined for any two memory (or
register) objects which are a NaN. An there are multiple bit-wise
representations which are a NaN which is different to say an Infinity or
a Zero of which there are only two of each and they are distinguishes from
each other by the sign. Remember the sign of a NaN has no special meaning.
I had a look in
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3938r1.html
But I do not have time to review it before your meeting next week.
One thing jumped out at me however:
The value of a floating-point-literal never has negative sign bit.
A value can only be positive or negative. That said, at least in C, the
negative sign in front of say
1234.5678
is not part of the definition of a literal so that mathematically, a
literal in C, is always a positive number although because
0.0
is a literal, a literal is not always strictly positive.
I could always be wrong. It has happened way too many times in the past!
Thanks - Damian
More information about the cfp-interest
mailing list