Elemental Intrinsic Function (Generic): Returns the smallest integer greater than or equal to its argument.
Syntax
Results:
The result is of type integer. If kind is present, the kind parameter of the result is that specified by kind; otherwise, the kind parameter of the result is that of default integer. If the processor cannot represent the result value in the kind of the result, the result is undefined.
The value of the result is equal to the smallest integer greater than or equal to a.
Compatibility
CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB
See Also: FLOOR
Examples
CEILING (4.8) has the value 5.
CEILING (-2.55) has the value -2.0.
The following shows another example:
INTEGER I, IARRAY(2)
I = CEILING(8.01) ! returns 9
I = CEILING(-8.01) ! returns -8
IARRAY = CEILING((/8.01,-5.6/)) ! returns (9, -5)