Inspectopedia
 
2024.3

Comparison to 'Double.NaN' or 'Float.NaN'

Warning
New
Last modified: 03 December 2024

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:

After the quick-fix is applied: