Loading...
Select Version
The INTEGER function returns the greatest integer that is less than or equal to the value of argument-1.
The type of this function is integer.
Format
FUNCTION
INTEGER
(argument-1)
Argument
argument-1 must be class "numeric" and must be greater than or equal to
-
1031+1 and less than 1031.
Returned values
The returned value is the greatest integer less than or equal to the value of argument-1. For example, if the value of argument-1 is
-
1.5,-
2 is returned. If the value of argument-1 is +1.5, +1 is returned.The error default value is
-
9’999’999’999’999’999’999’999’999’999’999.
See also: INTEGER-PART
Example 9-16
... DATA DIVISION. WORKING-STORAGE SECTION. 01 RES PIC 9(8). PROCEDURE DIVISION. P1 SECTION. MAIN. COMPUTE RES = FUNCTION INTEGER (-3.3). DISPLAY RES UPON T. STOP RUN.
Result: 00000004