Skip to content

mod

a number that wraps around, like a clock

1
# mod
2
5 mod 75 (mod 7)
Example outputCtrl+Enter to run
1
# arithmetic wraps around
2
(5 mod 7) * 31 (mod 7)
Example outputCtrl+Enter to run
  • mod_inv the number b from 0 to m - 1 for which a × b leaves remainder 1 when divided by m
  • residue the plain integer a mod value is at, from 0 to its modulus - 1
  • modulus the number a mod value wraps around at

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.