COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-37
MOD Function
MOD Function
MOD, an integer function, returns the value that is argument-1 modulo
argument-2.
argument-1
is an integer.
argument-2
is a nonzero integer.
The returned value is argument-1 modulo argument-2, which is defined:
Example 14-26. MOD Function
Code:
DISPLAY FUNCTION MOD (11 5)
DISPLAY FUNCTION MOD (-11 5)
DISPLAY FUNCTION MOD (11 -5)
DISPLAY FUNCTION MOD (-11 -5)
Output:
00001
00004
-00004
-00001
( )
MODFUNCTION argument-1 argument-2
VST444.vsd
argument-1 argument-2 FUNCTION INTEGER
argument-1
argument-2
---------------------
×
–