Why do comparisons of NaN values behave differently from all other values? That is, all comparisons with the operators ==, <=, >=, <, > where one or both values is NaN
It only looks peculiar because most programming environments that allow NaNs do not also allow 3-valued logic. If you throw 3-valued logic into the mix, it becomes consistent:
Even .NET does not provide a bool? operator==(double v1, double v2)
operator, so you are still stuck with the silly (NaN == NaN) = false
result.