Previous Topic: MinimumNext Topic: Next Integer Equal or Higher


Modulo

The modulo function returns the modulus (remainder) of one numeric value divided by another.

Syntax:

►►─┬─ MOD ────┬─ (dividend, divisor) ─────────────────────────────────────────►◄
   ├─ @MOD ───┤
   └─ MODULO ─┘

Invocation names:

MOD
@MOD
MODULO

Parameters:

dividend

Specifies the numeric value that is divided by divisor.

divisor

Specifies the numeric value that is divided into dividend.

Example:

This example determines the remainder resulting from the division of two numeric values. The initial value of OPER1 is 43, and the initial value of OPER2 is 10.

select mod(oper1,oper2) as 'remainder' from table1

  REMAINDER = 3