Testing oddity of an integer with the modulo operator
Might be because (i % 2) != 0
works for both positive and negative numbers
Because when i
is negative --> (-1) % 2 == -1
Might be because (i % 2) != 0
works for both positive and negative numbers
Because when i
is negative --> (-1) % 2 == -1