**[Jay Brown]** *"Could you explain to me the what the % is doing?"*
Gladly.

% is the symbol for the

modulo operator [link], which returns the remainder after integer division.

For example, (9 % 2) is 1. 9 divided by 2 (with integer division) is 4 with a remainder of 1. (100 % 3) is 1, because 100/3 = 33 with a remainder of 1.

Even numbers are evenly divisible by 2, meaning the remainder is 0; odd numbers are not evenly divisible by 2. By checking the remainder after we divide by 2 with integer division, we can tell if a number is even or odd.

Walter Soyka

Designer & Mad Scientist at

Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting

@keenlive [twitter] |

RenderBreak [blog] |

Profile [LinkedIn]