I don't understand why there is extra space before the mod in this formula.
How can I force the m and the 0 to be aligned vertically?
Here is the LaTeX code I'm using.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
f(x)&=\begin{cases}
\mod(x , 3) &\text{; if } x \neq 0\
0&\text{; if } x = 0
\end{cases}
\end{align}
\end{document}



\bmodmacro in comments. – Celdor Oct 19 '22 at 09:59mod, the one you're using here always assumes it comes after something, which is not the case here. – daleif Oct 19 '22 at 10:16\bmodis not the right tool. – egreg Oct 19 '22 at 12:11\text{mod}? I think it's useful in this case. – manh3 Oct 19 '22 at 13:26