The function is used to determine the remainder of the division of first argument by the second argument. Both arguments must be real numbers.

This can be represented as:

where

The following is an example of the mod function:

The value 5.5 is divided by 2.0 which is 2.75 which is then rounded down to the nearest whole number of 2.

Thus 5.5-2.0*2.0=1.5

Return to