QuackatronHQ / Gigarepo

Use double.IsNaN() to check if a double is NaN CS-W1003
Bug risk
Critical
2 months agoa year old
Comparison with NaN always evaluates to false
19        var pi = 3.14;
20        // CS-W1003: Invalid comparison against `NaN`.
21        // https://deepsource.io/directory/analyzers/csharp/issues/CS-W1003
22        var isNaN = pi == double.NaN;23
24        // CS-W1025: Potential memory leak inside `for` loop due to `stackalloc`.
25        // https://deepsource.io/directory/analyzers/csharp/issues/CS-W1025.