Back to Numbers
Numbers › Modulo
Modulo (clock arithmetic)
When you divide n by m, the modulo is what's left over. It's the same as a clock that wraps around.
Modulo — clock arithmetic
Wind a clock with 12 positions on past 17. Where does it land?
0
1
2
3
4
5
6
7
8
9
10
11
n (17)
modulo m (12)
17 mod 12 = 5
How to read it
23 mod 12 = 11. Wind a 12-position clock past 23 and the hand stops at 11. The mod tells you the position in the cycle.
Real uses
Days of the week (mod 7), hours of the day (mod 24), pixel colour channels (mod 256), cryptography (mod a giant prime).