# Remainder of a division (mod)

Remainder of a division of whole numbers.

## How to write it

### mod(a, b)

**a**

The dividend. Takes a whole number.

**b**

The divisor. Takes a whole number.

## Examples

- $\displaystyle 17 \bmod 5 = 2$

  `mod(17, 5)`

  In the solver, `mod(17, 5)` gives `2`.

  [Open in the solver](https://hilberon.com/?q=mod%2817%2C%205%29)
- $\displaystyle (-3) \bmod 5 = 2$

  `mod(-3, 5)`

  In the solver, `mod(-3, 5)` gives `2`.

  [Open in the solver](https://hilberon.com/?q=mod%28-3%2C%205%29)

## Related functions

- [negate](https://hilberon.com/library/negate)

  The negative of a number: the function form of a minus sign.
- [min](https://hilberon.com/library/min)

  The smallest of some numbers.
- [plus](https://hilberon.com/library/plus)

  Sum of numbers: the function form of +.
- [max](https://hilberon.com/library/max)

  The largest of some numbers.
- [power](https://hilberon.com/library/power)

  A power: the function form of ^.
- [log2](https://hilberon.com/library/log2)

  Logarithm to base 2.

---
Source: https://hilberon.com/library/mod
