Language: C# | Type: CODE_SMELL | Severity: Critical
Tags: suspicious
Certain mathematical comparisons will always return the same value, and should not be performed.
Specifically, the following comparisons will return either always true or always false depending on the kind of
comparison:
char with a numeric constant that is outside of the range of charfloat with a numeric constant that is outside of the range of floatlong with a numeric constant that is outside of the range of longulong with a numeric constant that is outside of the range of ulong
float f = 42.0f;
if (f <= double.MaxValue) { } // Noncompliant: always true
if (f > double.MaxValue) { } // Noncompliant: always false