> For the complete documentation index, see [llms.txt](https://docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keyfax.biz/product-suite/admin/databox-expressions/numeric-expressions/mod.md).

# Mod

Modular arithmetic is used when we are only interested in what the remainder will be when we divide one number by another. For these cases there is an operator called the modulo operator (abbreviated as Mod).

<table><thead><tr><th>Expression</th><th>Databox Value</th><th width="105">Result</th><th>Comments</th></tr></thead><tbody><tr><td><code>Mod(12)</code></td><td>38</td><td>2</td><td>Modular Arithmetic returns the remainder when divided by n. e.g. Mod(2) returns 0 for an even number and 1 for an odd number.<br>Mod(12) can be used for Clock Arithmetic</td></tr></tbody></table>
