for i in 1…5

next if i % 2 == 0

print i

end

This will produce all odd numbers 1,3,5, but my question is why? As I understand it, the loop reads as follows “If i divided by 2 produces no remainder, then put i”. From this logic, this if loop should produce all the even numbers rather than the odd numbers, as all even numbers satisfy the no remainder expression. Since it says to put i if it has no remainder, it should put even numbers.

This is not the case, why?

Thanks,