Previous Topic Next topic Print topic


CEIL Function

Purpose

Returns the smallest integer greater than or equal to the specified arithmetic expression.

Syntax

CEIL(x)

Parameters

x is an arithmetic expression.

Description

The CEIL function returns the smallest integer greater than or equal to x with precision (p,q). The result has the same data type as x.

If x is a floating-point value, the precision of the result is the precision of x. If x is a fixed-point value, the precision of the result is (MIN(n,MAX(p-q+1,1)),0). n is the maximum precision allowed for a fixed-point value of the result type. (For details, see your Open PL/I User's Guide.)

Examples

CEIL(-3.1)  /* returns -3.0 */ 
CEIL(3.1)  /* returns 4.0 */ 
CEIL(0)  /* returns 0 */

Restrictions

None.

Previous Topic Next topic Print topic