%Mod meta-SQL element

Syntax

%Mod(a, b)

Description

Use the %Mod meta-SQL function to return the remainder (or modulo) of division of one number by another number. %Mod uses the integer portion of both the dividend and the divisor. If the divisor is 0, %Mod returns the dividend value.

Parameters

Parameter Description

a

Specifies the dividend as a number.

b

Specifies the divisor as a number.

Example

Each of the following examples shows the computed result of the %Mod function:

%Mod(10, 3) = 1
%Mod(9, 3) = 0
%Mod(10.1, 3) = 1
%Mod(-10, 3) = -1
%Mod(10, 0)= 10

Related Topics