S2583 doesn't take into account casting can change numbers


(Paul Hickman) #1


Rule S2583 claims the following expression is always true, but it is only true if t is a whole number:

private static string IsInt(double t) => t == (int)t ? "yes" : "no";

(Valeri Hristov) #2

Hi Paul, thanks for the feedback! This is a known issue, unfortunately the solution is not trivial and so far we haven’t worked on it…