remainder
remainder(x_integer1x_integer2) =>x_integer
Description
Returns the remainder of dividing two integers. The remainder is either zero or has the sign of the dividend. Same as mod.
The remainder 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
|
Remainder of dividing x_integer1 by x_integer2. The sign is determined by the sign of x_integer1. |
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