What does the % operator do in Ruby in N % 2?

Viewed 66651

if counter % 2 == 1 I am trying to decode this line - it's a Rails project and I am trying to figure out what the % does in this if statement.

9 Answers
Related