NaN Signaling NaNs do not appear as the result of arithmetic operations. When they appear as an operand, they signal an invalid exception.
Quiet NaNs propagate through almost all operations without signaling exceptions. They are useful for debugging. Whenever a floating point operation is invalid, a quiet NaN is returned.
I didn’t quite follow this section! For example, why is \(\min(1,\mathrm{qNaN})\)?
Arithmetic of Infinities and Zeros
- \((-1/-0)=\infty\)
- \(-5/\infty=-0\)
- \(\sqrt{\infty}=\infty\)
Here’s a gotcha. Suppose you are trying to calculate:
with \(x\in(\sqrt{\Omega},\Omega]\). The denominator will be \(\infty\) in round to nearest, and the result will be 0. But the actual correct result is very close to 1.
So one needs to check if an overflow occurred.