Mod Function
mod('number','number') determines the remainder of dividing the first argument by the second argument. Both arguments must be real numbers.
This can be represented as:

where a is the first argument and n is the second. a divided by n is rounded down to the nearest whole number.
Here is an example of the mod() function:

5.5 divided by 2.0 is 2.75, which is then rounded down to the nearest whole number, 2. So 5.5 - 2.0×2.0 = 1.5.
This page is based on a legacy wiki article by Edward Ulle.