Modulo Calculator
Calculate modulo operations (remainder after division) with step-by-step explanations
Calculate Modulo Operation
The number being divided
The number dividing (must be non-zero)
Clock Arithmetic Example
🕚 Time Calculation
Current time: 11:00 PM
Sleep duration: 8 hours
Calculation: (11 + 8) mod 12 = 19 mod 12 = 7
Wake up time: 7:00 AM 🕖
🍕 Pizza Sharing
Total slices: 10
People: 3
Calculation: 10 mod 3 = 1
Each person gets: 3 slices, 1 slice left over
Common Modulo Results
Modulo Properties
x mod y is always between 0 and y-1
If x < y, then x mod y = x
x mod 1 is always 0
Even numbers: x mod 2 = 0
Odd numbers: x mod 2 = 1
Modulo in Programming
Understanding Modulo Operations
What is Modulo?
The modulo operation finds the remainder after division of one number by another. When we write "x mod y = r", we're saying that x divided by y leaves a remainder of r.
Mathematical Definition
x = q x y + r
where 0 ≤ r < |y|
- x: dividend (number being divided)
- y: divisor (number dividing by)
- q: quotient (whole number result)
- r: remainder (modulo result)
Real-World Applications
- •Time calculations: 12-hour and 24-hour formats
- •Cryptography: RSA encryption and hash functions
- •Check digits: ISBN, credit card validation
- •Computer graphics: Texture wrapping and animations
- •Data structures: Hash tables and circular arrays
Modular Congruence
a ≡ b (mod n)
"a is congruent to b modulo n"
This means a and b have the same remainder when divided by n
Modular Arithmetic Rules
Addition
(a + b) mod n =
((a mod n) + (b mod n)) mod n
Multiplication
(a x b) mod n =
((a mod n) x (b mod n)) mod n
Exponentiation
a^b mod n =
((a mod n)^b) mod n