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() for the quotient and mod() when a modulo convention is specifically needed.

Check divisibility with equal(): rem(n, d) equal to zero means d divides n. Pair with floor() when constructing quotient-and-remainder calculations.

Try Rem in Calcul.io

Start with one of the editable examples above, then replace its arguments with your own values. Keeping the function on a separate calculator line makes the input and result easy to compare. For a longer workflow, assign the result to a variable or reference that line in the next expression.

Check the shown signature before adding optional arguments, and use the related-function links to compare operations with similar purposes.

All functions