//// This rule is superseded by RSPEC-2583
//// Please consider implementing this latter instead.
Because the value in a variable of an unsigned type or ``++enum++`` can never be less than zero, testing to see if it is negative or checking its absolute value is a useless operation which can only confuse future readers of the code.


== Noncompliant Code Example

----
unsigned int i = 0; // the lowest value this var can have
...
if (i >= 0) { // Noncompliant
  do_x(i);
}
unsigned int j = abs(i); // Noncompliant
...
----


== Compliant Solution

----
unsigned int i = 0;
...
do_x(i);
unsigned int j = i;
...
----


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
