Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : MOD

MOD
Returns the modulus from dividing the dividend by the divisor. The function MOD handles negative dividends and divisors. (F)
Invocation
number = MOD(dividend, divisor)
 
Usage Notes
One or both of the values for dividend and divisor can be negative.

Exceptions
 
Example
The following rule determines the modulus of the division operation and prints it to the message log:

 
RULE EDITOR ===> SCROLL: P
MOD1(DIVIDEND,DIVISOR);
- lOCAL RESULT;
_ ---------------------------------------------------------------------------------
_ -------------------------------------------------------------------+-------------
_ RESULT = MOD(DIVIDEND, DIVISOR); | 1
_ CALL MSGLOG(DIVIDEND || ' MOD ' || DIVISOR || ' IS ' || | 2
_ RESULT); |
_ ---------------------------------------------------------------------------------

 
Resulting Output
Executing this rule with a dividend of -12 and a divisor of 10 displays the following to the message log.

 
-------------------INFORMATIONAL MESSAGE LOG ------------------------------
COMMAND ==> SCROLL===> P
-12 MOD 10 IS -2

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved