Loading…
Loading…
ModLab
Always non-negative result: ((a mod m) + m) mod m.
a mod m is just the remainder after dividing a by m — the same logic a clock uses: 14 o'clock 'wraps around' to 2 o'clock because 14 mod 12 = 2.
Modular arithmetic underlies cryptography, hashing, checksums, and any 'wraps around' scenario like days of the week or angles on a circle.
a mod m
2
Always returns a non-negative remainder.
What you entered
Divide and round down
⌊17 ÷ 5⌋= 3Subtract the product back out
17 − (5 × 3)= 2Result
a mod m: 2
17 mod 5 = 2.