Kernel.rem
You're seeing just the function
rem
, go back to Kernel module for more information.
Specs
rem(integer(), neg_integer() | pos_integer()) :: integer()
Computes the remainder of an integer division.
rem/2
uses truncated division, which means that
the result will always have the sign of the dividend
.
Raises an ArithmeticError
exception if one of the arguments is not an
integer, or when the divisor
is 0
.
Allowed in guard tests. Inlined by the compiler.
Examples
iex> rem(5, 2)
1
iex> rem(6, -4)
2