Boost logo

Boost :

From: Gero Peterhoff (g.peterhoff_at_[hidden])
Date: 2022-02-18 13:52:03


Am 17.02.22 um 18:44 schrieb John Maddock via Boost:
>
>>> Does anyone have a (non-theoretical) use case for signalling quad-precision NaN's?  And or a working test case?
>>>
>>> Thanks, John.
>>>
>> Crap, neither does snanf128, of course; hope that's it then :-)
>> https://godbolt.org/z/v854oG8E5
>
> That generates a NaN that has the same general appearance as a double-precision signalling NaN, but I'm unable to actually make it *signal*.  Unless this is supported by GCC and libquadmath, it still looks to me that there are no signalling NaN's for __float128?  To repeat myself: do you have a working test case where signalling NaN's actually do something useful?  Otherwise it looks to me as though has_signalling_NaN really should be false?
>
> John.
>
>
The difference between the values is (exponent: all bits set, sign bit cleared (libquadmath), https://en.wikipedia.org/wiki/NaN)
qnan: the most significant fraction bit must be set and/or any fraction bit must be set
snan: the most significant fraction bit must be clear and any fraction bit set. libquadmath always sets the second highest fraction bit.

I don't have a real example either, but std::isnan should work.

thx
Gero




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk