Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 9/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

FLOOR

Elemental Intrinsic Function (Generic): Returns the greatest integer less than or equal to its argument.

result = FLOOR (a[,kind])

a

(Input) Must be of type real.

kind

(Input; optional) Must be a scalar integer constant expression.

Results

The result type is 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 greatest integer less than or equal to a.

The setting of compiler options specifying integer size can affect this function.

Example

FLOOR (4.8) has the value 4.

FLOOR (-5.6) has the value -6.

The following shows another example:

I = FLOOR(3.1)  ! returns 3
I = FLOOR(-3.1) ! returns -4

See Also