Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

INTEGER-PART - Integer part of a floating-point value

The INTEGER-PART function returns an integer that is the integer portion of argument-1.
The type of this function is integer.

Format


FUNCTION INTEGER-PART (argument-1)


Argument

  1. argument-1 must be of class "numeric" and the value v of argument-1 must lie in the range -1031 < v < 1031

Returned values

  1. If the value of argument-1 is zero, the returned value is zero.

  2. If the value of argument-1 is positive, 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, +1 is returned.

  3. If the value of argument-1 is negative, the returned value is the least integer greater than or equal to the value of argument-1. For example, if the value of argument-1 is -1.5, -1 is returned.

  4. The error default value is - 9’999’999’999’999’999’999’999’999’999’999.


See also:
        INTEGER

Example 9-19

...
DATA DIVISION.
WORKING-STORAGE SECTION.
01  RES PIC 9(8).
PROCEDURE DIVISION.
P1 SECTION.
MAIN.
    COMPUTE RES = FUNCTION INTEGER-PART (-3.3).
    DISPLAY RES UPON T.
    STOP RUN.

Result:              -00000003