MOD() Function - Decimal Modulo (Remainder)

Syntax

MOD(numA,numB{,ERR=lineref})

Description

The MOD() function returns the modulo (remainder) result using the following rules:

  • If numB is 0, numA is returned.

  • If numB is not 0, numA - numB*floor(numA/numB) is returned, where floor returns the largest integer less than or equal to its argument.

Examples

>PRINT MOD(14,3)
2
>PRINT MOD(50,10)
0

See Also

Functions - Alphabetical Listing