IDE extension that lets you fix coding issues before they exist!
Setup is effortless and analysis is automatic for most languages
Fast, accurate analysis; enterprise scalability
double.NaN and float.NaN are not equal to anything, not even themselves.
When anything is compared with NaN using one of the comparison operators >, >=, <, ⇐ or the equality operator ==, the result will always be false. In contrast, when anything is compared with NaN using the inequality operator !=, the result will always be true.
NaN
>
>=
<
⇐
==
false
!=
true
Instead, the best way to see whether a variable is equal to NaN is to use the float.IsNaN and double.IsNaN methods, which work as expected.