Modulo (%) gives the remainder after division: a mod b = remainder of a ÷ b. It is fundamental to clock arithmetic, cryptography, hashing, cyclic patterns, and determining even/odd numbers. In programming, % is the modulo operator.
💡
Pro Tip
In Python, -7 % 3 = 2 (not -1). Python always returns a non-negative result for positive modulus. In C/Java, -7 % 3 = -1. This difference causes bugs — always test with negative numbers.
⭐
Did You Know?
The ISBN-13 barcode uses modulo 10 for its check digit: multiply alternate digits by 1 and 3, sum them, and the check digit makes the total divisible by 10. This detects single-digit errors with 100% accuracy.
References
🔒
100% Libre
Hindi kailangang mag-sign up
✓
Tumpak
Mga napatunayan na formula
⚡
Agarang
Resulta habang nagta-type
📱
Handa sa Mobile
Lahat ng device