Script Function: It returns the remainder of a division.
MOD(Operand1, Operand2)
Syntax |
Description/Format |
---|---|
Operand1 |
The first expression. |
Operand2 |
The second expression. |
Return code |
---|
Remainder of the division |
This script function returns the remainder of the division of Operand1 by Operand2.
Operand1 and Operand2 must be integers that are within the allowed value ranges of the data types "unsigned" and "signed". Floating point numbers are not supported. The result is always a positive or negative integer.
Operand2 must not be zero.
In the following example, this function returns the result "1".
:SET &rest# = MOD(10,3)
The result of the second example is "10".
:SET &rest# = MOD(10,44)
See also:
Script element | Description |
---|---|
Performs an addition. | |
SUB | Performs a subtraction. |
MULT | Performs a multiplication. |
DIV | Performs a division. |
RANDOM | Generates random numbers. |
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function