Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

unordered comparison

The fourth possible result of comparing floats - neither less, equal nor greater - which happens when either value is NaN.

IEEE 754 comparisons have four mutually exclusive outcomes, less, equal, greater and unordered; unordered holds exactly when at least one operand is a NaN, making every ordered predicate false.

Examples

  • Comparing NaN with 1.0 using ucomisd sets ZF, PF and CF all to 1: the result is unordered.

Read the full section →