# %REM (Return Integer Remainder)

`%REM(n:m)`

%REM returns the remainder that results from dividing operands **n** by **m**. The two operands must
be numeric values with zero decimal positions. If either operand is
a packed, zoned, or binary numeric value, the result is packed numeric.
If either operand is an integer numeric value, the result is integer.
Otherwise, the result is unsigned numeric. Float numeric operands
are not allowed. The result has the same sign as the dividend. (See
also %DIV (Return Integer Portion of Quotient).)

`%REM(A:B) = A - (%DIV(A:B) * B)`

If the operands are constants that can fit in 8-byte integer or unsigned fields, constant folding is applied to the built-in function. In this case, the %REM built-in function can be coded in the definition specifications.

For more information, see Arithmetic Operations or Built-in Functions.