# div equivalent to mod

What's the easiest way to define a \bdiv equivalent to \bmod, i.e., a binary operator for integer division?

I tried \meaning\bmod, but got very primitive TeX commands, so I'm sure there's a higher-level way to define it that would give me the Roman font and binary operation spacing.

-

You can find the definition of \bmod in latex.ltx or source2e. The example below just replaces mod with div:

\documentclass{article}

\makeatletter
\newcommand*{\bdiv}{%
\nonscript\mskip-\medmuskip\mkern5mu%
\mathbin{\operator@font div}\penalty900\mkern5mu%
\nonscript\mskip-\medmuskip
}
\makeatother

\begin{document}
$a\bmod b$
$a\bdiv b$
\end{document}


-
Thank you. Now I just have to find where Ubuntu put those two files on my system. :-) –  TOB Nov 10 '12 at 21:02
@TOB Just run texdoc source2e or kpsewhich latex.ltx. –  Heiko Oberdiek Nov 10 '12 at 21:34
Awesome, thanks! –  TOB Nov 11 '12 at 22:12