IEEE-754浮点标准说:
Four mutually exclusive relations are possible: less than, equal, greater than, and unordered. The last case arises when at least one operand is NaN. Every NaN shall compare unordered with everything, including itself.
echo phpversion() . " " . zend_version() . " " . php_uname() . "\n";
// 5.2.5 2.2.0 Linux 2cf38fbc9b9e 3.11.0-15-generic #25-Ubuntu SMP
// Thu Jan 30 17:22:01 UTC 2014 x86_64
NAN < NAN; // true
NAN > NAN; // true
INF < INF; // true
INF > INF; // true
很明显,NAN和NAN之间以及INF和INF之间存在多个关系,而应该只有一个.在许多(大多数?全部?)语言中,IEEE-754浮点数“无序”意味着NaN< NaN是假的,并且NaN> NaN为假,NaN == NaN为假.这是否证明PHP不使用IEEE-754浮点数?