Files
openide/java/java-impl/resources/inspectionDescriptions/ComparisonToNaN.html
2025-02-05 04:43:28 +00:00

16 lines
473 B
HTML

<html>
<body>
Reports any comparisons to <code>Double.NaN</code> or <code>Float.NaN</code>.
Such comparisons are never meaningful, as NaN is not equal to anything, including itself.
Use the <code>Double.isNaN()</code> or <code>Float.isNaN()</code> methods instead.
<p><b>Example:</b></p>
<pre><code>
if (x == Double.NaN) {...}
</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>
if (Double.isNaN(x)) {...}
</code></pre>
<!-- tooltip end -->
</body>
</html>