FLOOR Function

Purpose

Returns the largest integer that is less than or equal to the specified arithmetic expression.

Syntax

FLOOR(x)

Parameters

x is an arithmetic expression.

Description

The FLOOR function returns the largest integer that is less than or equal to an arithmetic expression 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 fixed-point values of the result type. (For details on maximum precisions, see your Open PL/I User's Guide.)

Examples

FLOOR(3.125)    /* returns 3.000 */
FLOOR(-3.125)   /* returns -4.000 */
FLOOR(0)        /* returns 0 */

Restrictions

None.