[UP]


Manual Reference Pages  - ceiling (3)

NAME

ceiling(3f) - [FORTRAN:INTRINSIC:NUMERIC] Integer ceiling function

CONTENTS

Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also

SYNTAX

result = ceiling(a [, kind])

DESCRIPTION

ceiling(a) returns the least integer greater than or equal to A.

ARGUMENTS

A - The type shall be REAL.
KIND - (Optional) An INTEGER initialization expression indicating the kind parameter of the result.

RETURN VALUE

The return value is of type integer(kind) if KIND is present and a default-kind INTEGER otherwise.

EXAMPLE

Sample program:

    program demo_ceiling
        real :: x = 63.29
        real :: y = -63.59
        print *, ceiling(x) ! returns 64
        print *, ceiling(y) ! returns -63
    end program demo_ceiling

STANDARD

[[Fortran 95]] and later

CLASS

[[Elemental procedure|Elemental function]]

SEE ALSO

[[floor]], [[nint]]


ceiling (3) March 18, 2019
Generated by manServer 1.08 from a5216751-b022-4262-b9f8-36f7f7cc4db2 using man macros.