IEEE 754:为什么谓词 == 和 != 没有发出信号?

IEEE 754: why predicates == and != are not signaling?

注意:了解IEEE 754,请耐心等待。

IEEE 754-2008:

Table 5.2 lists five unordered-signaling predicates and their negations that cause an invalid operation exception when the relation is unordered. That invalid operation exception defends against unexpected quiet NaNs arising in programs written using the standard predicates {<, <=, >=, >} and their negations, without considering the possibility of a quiet NaN operand.

问题:为什么 ==!= 谓词不在 {} 列表中?在使用谓词 ==!= 编写的程序中也会出现意外的安静 NaN。

Question: why == and != predicates are not in the {} list?

因为它是一个传统的信号谓词列表,而 ==!= 操作传统上是安静的。 {} 列表不是括号——它是所描述操作的枚举。该规范确实定义了信号 equalnotEqual 谓词,这些在 table 5.2 中列出,但它们根本不是引用的句子所谈论的内容。该规范还定义了Greater的安静版本。 (列于table 5.3);这些当然也不是引用的句子所说的。

所有信令版本,包括compareSignalingEqual()compareSignalingNotEqual(),都属性是

intended for use by programs not written to take into account the possibility of NaN operands

(介绍table5.2;重点在原文)。