Mod

mod returns the remainder of the division of one number by another.

Syntax

 mod(EXP_NUM1,EXP_NUM2)

Examples

 # Is the Integer MY_INTEGER even or odd?If mod(MY_INTEGER,2)=0# MY_INTEGER is evenElse# MY_INTEGER is oddEndif# Mod can be used with decimal valuesY = mod(1.1, 0.3)Y = 0.2

Description

mod(X,Y) returns:

The type of the result is determined by the type of the assignment variable.
 Local Decimal MY_DECIMAL MY_DECIMAL = mod(3.7,2) # Type assigned is decimal and value = 1.7Local Integer MY_INTEGERMY_INTEGER = mod(3.7,2) # Type assigned is integer and value = 1

Associated errors

Error codeDescription
10At least one of the arguments is not numeric.

See also

fix.