Floating point math is imprecise because of the challenges of storing such values in a binary representation. Even worse, floating point math is not associative; push a ``++float++`` or a ``++double++`` through a series of simple mathematical operations and the answer will be different based on the order of those operation because of the rounding that takes place at each step.
Therefore, the use of the equality (``++==++``) and inequality (``++!=++``) operators on ``++float++`` or ``++double++`` values is almost always an error. Instead the best course is to avoid floating point comparisons altogether. When that is not possible, you should consider using one of Java's float-handling ``++Numbers++`` such as ``++BigDecimal++`` which can properly handle floating point comparisons. A third option is to look not for equality but for whether the value is close enough. I.e. compare the absolute value of the difference between the stored value and the expected value against a margin of acceptable error. Note that this does not cover all cases (``++NaN++`` and ``++Infinity++`` for instance).
Since ``++NaN++`` is not equal to itself, the specific case of testing a floating point value against itself is a valid test for ``++NaN++`` and is therefore ignored. Though using ``++Double.isNaN++`` method should be preferred instead, as intent is more explicit.