Excerpt | ||
---|---|---|
| ||
mod(dividend, divisor) Returns the remainder after dividing a dividend by a divisor. |
Function: mod
Returns the remainder after dividing a dividend by a divisor.
Syntax
mod(dividend, divisor)
Argument | Type | Description |
---|---|---|
dividend | Number | Single A single number, or list of numbers, to be divided by the divisor. |
divisor | Number | 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)
mod() returns 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.