COBOL Manual for TNS and TNS/R Programs

Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs522555-006
14-24
INTEGER-PART Function
INTEGER-PART Function
INTEGER-PART, an integer function, returns the integer part of its argument.
argument
is a numeric argument.
The returned value is determined as shown in this table:
Value of argument Returned Value
Zero Zero
Positive Greatest integer less than or equal to the value of argument
Negative Least integer greater than or equal to the value of argument
Example 14-16. INTEGER-PART Function
Code:
DISPLAY FUNCTION INTEGER-PART (-1.5)
DISPLAY FUNCTION INTEGER-PART (-1)
DISPLAY FUNCTION INTEGER-PART (0)
DISPLAY FUNCTION INTEGER-PART (1)
DISPLAY FUNCTION INTEGER-PART (1.5)
Output:
-1
-1
0
1
1
( )
INTEGER-PARTFUNCTION argument
VST434.vsd