# rem() Function & Examples

Use the rem() math function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

Try it yourself:

---

## rem(): Division Remainder

**rem()** returns the remainder after division. For rem(17, 5), the result is 2. It is useful for cycles, divisibility checks, and wrapping positions.

## Signs and zero

The divisor must not be zero. Remainder sign conventions can matter with negative operands, so test the behavior required by your application. Use [divide()](https://calcul.io/function/divide/index.md) for the quotient and [mod()](https://calcul.io/function/mod/index.md) when a modulo convention is specifically needed.

Check divisibility with [equal()](https://calcul.io/function/equal/index.md): rem(n, d) equal to zero means d divides n. Pair with [floor()](https://calcul.io/function/floor/index.md) when constructing quotient-and-remainder calculations.

[All functions](https://calcul.io/functions/index.md)
