Comparison to 'Double.NaN' or 'Float.NaN'
Reports any comparisons to Double.NaN
or Float.NaN
. Such comparisons are never meaningful, as NaN is not equal to anything, including itself. Use the Double.isNaN()
or Float.isNaN()
methods instead.
Example:
if (x == Double.NaN) {...}
After the quick-fix is applied:
if (Double.isNaN(x)) {...}
Inspection Details | |
---|---|
Available in: | IntelliJ IDEA 2023.3, Qodana for JVM 2023.3 |
Plugin: | Java, 233.SNAPSHOT |
Last modified: 13 July 2023