Mod operator (LotusScript® Language)

Divides two numbers and returns the remainder.

Syntax

numExpr1 Mod numExpr2

Elements

numExpr1, numExpr2

Any numeric expressions. An EMPTY operand is considered a 0.

Return value

The result is of data type Integer, Long, or Variant of type Integer or Long.

If either or both operands are NULL expressions, the result is a NULL.

Usage

The remainder operator divides numExpr1 by numExpr2 and returns the remainder.

The operands are rounded to Integer expressions before the division takes place.

Example

This example contrasts Modulo division with ordinary division. Mod returns the remainder, while ordinary division returns the dividend.

Print 12 Mod 8               ' Prints 4
Print 12 / 8                 ' Prints 1.5