3
$\begingroup$

To me it looks that it is:

  • irreflexivity: NaN < NaN == false
  • transitivity: if a < b and b < c then a < c (the antecedent is never true for NaNs)
  • asymmetry: if a < b then not b < a (again, the antecedent is never true for NaNs)

However, it cannot be extended to non-strict partial ordering <= because there's no (reflexive) equality for doubles (NaN != NaN).

$\endgroup$
4
$\begingroup$

Yes, it is. (Though you need to consider signed zero as well as NaNs.) For extra confirmation:

So, the floating-point operator< does not form weak order and therefore does not form a total order. It is, however, a partial order.

However, it cannot be extended to non-strict partial ordering <= because there's no (reflexive) equality for doubles (NaN != NaN).

It can be extended, but <= as defined by IEEE isn't that extension.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.