'Modulus' means two things: the absolute value of a complex number, written with bars, and the mod operation of number theory. LaTeX has three mod commands with different spacing and parentheses; \bmod for an operator inside an expression, \pmod to end a congruence.
All ways to write it
| Command | Use | Package | Copy |
|---|---|---|---|
|z| | modulus of a complex number | none | |
a \bmod n | binary mod, no parentheses | none | |
a \equiv b \pmod{n} | congruence with (mod n) | none | |
a \mod n | mod with leading space | none | |
\operatorname{mod} | upright word form | none |
Example
|3 + 4i| = 5, \qquad 17 \bmod 5 = 2Complex modulus and the remainder operation.
Questions
\bmod, \pmod or \mod?
\bmod inside an expression (a \bmod n). \pmod{n} at the end of a congruence with parentheses. \mod is like \pmod without the parentheses.
Related symbols
- Absolute value |x|
|x| - Equivalent ≡
\equiv - Divides ∣
\mid
Using modulus / mod in Confluence
Confluence Cloud has no built-in LaTeX. With LaTeX Math for Confluence you add a math macro to any page, type |z| and it renders inline or as a block, with a live preview while you edit. Every command on this page renders there without extra packages.