modulo
modulo(x_integer1x_integer2) =>x_integer
Description
Returns the remainder of dividing two integers. The remainder always has the sign of the divisor.
The remainder (mod) and modulo functions differ on negative arguments. The remainder is either zero or has the sign of the dividend if you use the remainder function. With modulo the return value always has the sign of the divisor.
Arguments
Value Returned
|
The remainder of the division. The sign is determined by the divisor. |
Examples
modulo( 13 4)
=> 1
remainder( 13 4)
=> 1
modulo( -13 4)
=> 3
remainder( -13 4)
=> -1
modulo( 13 -4)
=> -3
remainder( 13 -4)
=> 1
modulo( -13 -4)
=> -1
remainder( -13 -4)
=> -1
Related Topics
Return to top