Section 6.1 of the IEEE 754-2019 standard states that:
The behavior of infinity in floating-point arithmetic is derived from the limiting cases of real arithmetic with operands of arbitrarily large magnitude, when such a limit exists. Infinities shall be interpreted in the affine sense, that is: −∞ < {every finite number} < +∞.
However, in all implementations that I've used Inf * 0 = NaN
, which seems to contradict quoted text.
Where in the IEEE 754 standard is the result of Inf * 0
specified?
IEEE 754-2008 7.2 says:
The invalid operation exception is signaled if and only if there is no usefully definable result. In these cases the operands are invalid for the operation to be performed.
For operations producing results in floating-point format, the default result of an operation that signals the invalid operation exception shall be a quiet NaN that should provide some diagnostic information (see 6.2). These operations are:
…
b) multiplication: multiplication(0, ∞) or multiplication(∞, 0)
…
A near final draft of 754-2019 is identical in the parts quoted above.