X MOD Y is the remainder from a division which produces an integral quotient and is defined as X - Y * (X DIV Y). If one or both of the operands are REAL, the result is REAL; otherwise the result is INTEGER.
Note that MOD is similar to MODULO but gives a different result only when X/Y is negative. This is because MODULO uses the formula X - Y * INT(X/Y), whereas MOD uses X - Y * (X DIV Y). This means when X/Y is negative INT(X/Y) converts to integer by truncation toward negative infinity, whereas with MOD, (X DIV Y) converts to integer by truncation toward zero.