CEILING(A, KIND)

Purpose

Returns the least integer greater than or equal to its argument.

Class

Elemental function

Argument type and attributes

A
must be of type real.
KIND (optional)
must be a scalar integer constant expression.

Result type and attributes

Result value

The result has a value equal to the least integer greater than or equal to A.

The result is undefined if the result cannot be represented as an integer of the specified KIND.

Examples

CEILING(-3.7) has the value -3.
CEILING(3.7) has the value 4.
CEILING(1000.1, KIND=2) has the value 1001, with a kind
type parameter of two.