Loading...
Select Version
The REM function returns a numeric value that is the remainder of argument-1 divided by argument-2.
The type of this function is numeric.
Format
FUNCTION REM (argument-1 argument-2)
Arguments
argument-1 and argument-2 must be class "numeric".
The value of argument-2 must not be zero.
The value v of the quotient argument-1/argument-2 must lie in the range - 1031
<v < 1031
Returned values
The returned value is the remainder of argument-1 / argument-2. It is defined as the expression:
argument-1-(argument-2 * FUNCTION INTEGER-PART (argument-1 / argument-2))The error default value is
-9’999’999’999’999’999’999’999’999’999’999.
See also: MOD
Example 9-39
...
DATA DIVISION.
WORKING-STORAGE SECTION.
01 R PIC 999.
PROCEDURE DIVISION.
P1 SECTION.
MAIN.
COMPUTE R = FUNCTION REM (928 14).
DISPLAY R UPON T.
STOP RUN.
Result: 004