FLOOR(A, KIND)

Purpose

Returns the greatest integer less than or equal to its argument.

Class

Elemental function

Argument type and attributes

A
must be of type real.
Fortran 95
KIND (optional)
must be a scalar integer initialization expression.
End of Fortran 95

Result type and attributes

Result value

The result has a value equal to the greatest integer less than or equal to A.

Fortran 95

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

End of Fortran 95

Examples

FLOOR(-3.7) has the value -4.
FLOOR(3.7) has the value 3.
Fortran 95
FLOOR(1000.1, KIND=2) has the value 1000, with a kind type parameter of two.
End of Fortran 95