3 ms·
> and I'm pretty sure that NaN addition, while resulting in a NaN, does not need to preserve the original bit pattern. "it be complicated" Except for certain
by jcranmer 4y ago
> and I'm pretty sure that NaN addition, while resulting in a NaN, does not need to preserve the original bit pattern.
"it be complicated"
Except for certain operations (fneg, fcopysign, and fabs are all defined to only affect the sign bit, to the point that they're an exception to the sNaN-always-signals rule; and there are a few operations defined to operate on the NaN payload information), IEEE 754 generally says no more than a qNaN is generated. There's a recommendation that NaN payloads propagate, and most hardware does do that, but compilers actually typically don't even guarantee that sNaNs are not produced by operations.
- eesmith 4y ago> There's a recommendation that NaN payloads propagate I looked more closely, and yes, the signalling NaN + 0.0 always changed the bit pattern, and the quiet NaN + 0.0 always stayed the same. Thank you for your informative details about IEEE 754.