Returns the remainder of dividing x by n.
mod(x,n)
Name | Description |
---|---|
x | represent a number input |
n | divisor part of the expression |
The modulus function returns the remainder of a division operation. The function has many applications in computer science and cycle-related problems. For example, given the input mod(5,3)
the remainder of dividing 5
by 3
is 2
, which is the output of the function.
The examples shown below use the divisor of 3
.