Unsourced material may be challenged creation of inequality flannery pdf removed. NaN: “quiet NaN” or “signaling NaN”.

NaN then the value of the other operand is returned. The other standard comparison predicates are all signaling if they receive a NaN operand, the standard also provides non-signaling versions of these other predicates. Operations with a NaN as at least one operand. The square root of a negative number. The logarithm of a negative number. 1 or greater than 1. If an operation can produce an exception condition and traps are not masked then the operation will cause a trap instead.

If an operand is a quiet NaN, and there isn’t also a signaling NaN operand, then there is no exception condition and the result is a quiet NaN. In practice, this approach is faced with many complications. Traps are not required by the standard. There are other approaches to this sort of problem that would be more portable. One view is that the NaN should propagate to the output of the function in all cases to propagate the indication of an error.

1 since they return 1 whatever else is used instead of quiet NaN. Generally, C99 eschews a NaN result where a numerical value is useful. NaN” for the result of strings that don’t represent valid integers. Different operating systems and programming languages may have different string representations of NaN. The sign bit does not matter. In practice, the most significant bit of the significand field determined whether a NaN is signaling or quiet. NaN is quiet, and to zero if the NaN is signaling.

NaN is quiet, and non-zero if the NaN is signaling. Thus, on these processors, the bit represents an ‘is_signaling’ flag. 0 could yield an infinity. For binary formats, the most significant bit of the significand field should be an ‘is_quiet’ flag.