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