When the modulus of a negative number is calculated, the result will either be negative or zero. Thus, comparing the modulus of a variable for
equality with a positive number (or a negative one) could result in unexpected results.

## Noncompliant Code Example

func isOdd(x:Int) -> Bool {
return x % 2 == 1 // Noncompliant; if x is negative, x % 2 == -1
}

## Compliant Solution

func isOdd(x:Int) -> Bool {
return x % 2 != 0
}

or

func isOdd(x:Int) -> Bool {
return abs(x % 2) == 1
}

## See

- CERT, NUM51-J. - Do not assume that the remainder operator always returns a
nonnegative result for integral operands
- CERT, INT10-C - Do not assume a positive remainder when using the % operator