Testing for even vs. odd numbers

Is there an easy way to build conditions around even and odd numbers? e.g. if even or if odd?

Sure!

The operator mod(a,b) returns the remainder when dividing a by b. So

mod($MyNumber,2)

is true if MyNumber is odd, and false if $MyNumber is even.

2 Likes