What is modulo?
Modulo is the remainder after division. For example, 17 divided by 5 gives quotient 3 with remainder 2, so 17 mod 5 equals 2.
Modulo in programming
Many programming languages use the % symbol for modulo or remainder. Be careful with negative numbers: JavaScript uses truncated division, while Python uses floored division.
Clock arithmetic and modular arithmetic
Clock arithmetic is modular arithmetic in daily life. After 12 o'clock, the next hour wraps back to 1 instead of continuing to 13.
Negative numbers and modulo
Different systems choose different quotients for negative divisions, which changes the remainder. Euclidean modulo keeps the remainder non-negative, which is often the cleanest choice in mathematics.