mod
Function: mod
Returns the remainder after dividing a dividend by a divisor.
Syntax
mod(dividend, divisor)
Argument | Type | Description |
---|---|---|
dividend | Number | A single number, or list of numbers, to be divided by the divisor. |
divisor | Number | The number used to divide the dividend. |
Examples
mod(8,7)
Returns 1
Explanation: 8 / 7 = 1 with a remainder of 1. The modulus function returns the remainder.Â
mod([3,5,7],5)
Returns [3,0,2]
Explanation: 3 / 5 = 0 with a remainder of 3. The dividend 3 is not wholly divisible by the divisor 5, returning 0, therefore the remainder is 3.