Intel® Fortran Compiler 18.0 Developer Guide and Reference

INT

Elemental Intrinsic Function (Generic): Converts a value to integer type.

result = INT (a[,kind])

a

(Input) Must be of type integer, real, or complex, or a binary, octal, or hexadecimal literal constant.

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 shown in the following table. If the processor cannot represent the result value in the kind of the result, the result is undefined.

Functions that cause conversion of one data type to another type have the same effect as the implied conversion in assignment statements.

The result value depends on the type and absolute value of a as follows:

Specific Name 1

Argument Type

Result Type

INTEGER(1), INTEGER(2), INTEGER(4)

INTEGER(4)

INTEGER(1), INTEGER(2), INTEGER(4),

INTEGER(8)

INTEGER(8)

IJINT

INTEGER(4)

INTEGER(2)

IIFIX2

REAL(4)

INTEGER(2)

IINT

REAL(4)

INTEGER(2)

IFIX 3, 4

REAL(4)

INTEGER(4)

JFIX

INTEGER(1), INTEGER(2), INTEGER(4),

INTEGER(8), REAL(4), REAL(8), REAL(16),

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(4)

INT 5, 6, 7

REAL(4)

INTEGER(4)

KIFIX

REAL(4)

INTEGER(8)

KINT

REAL(4)

INTEGER(8)

IIDINT

REAL(8)

INTEGER(2)

IDINT 6, 8

REAL(8)

INTEGER(4)

KIDINT

REAL(8)

INTEGER(8)

IIQINT

REAL(16)

INTEGER(2)

IQINT6, 9

REAL(16)

INTEGER(4)

KIQINT

REAL(16)

INTEGER(8)

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(2)

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(4)

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(8)

INT110

INTEGER(1), INTEGER(2), INTEGER(4),

INTEGER(8), REAL(4), REAL(8), REAL(16),

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(1)

INT210

INTEGER(1), INTEGER(2), INTEGER(4),

INTEGER(8), REAL(4), REAL(8), REAL(16),

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(2)

INT410

INTEGER(1), INTEGER(2), INTEGER(4),

INTEGER(8), REAL(4), REAL(8), REAL(16),

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(4)

INT810

INTEGER(1), INTEGER(2), INTEGER(4),

INTEGER(8), REAL(4), REAL(8), REAL(16),

COMPLEX(4), COMPLEX(8), COMPLEX(16)

INTEGER(8)

1These specific functions cannot be passed as actual arguments.

2This function can also be specified as HFIX.

3The setting of compiler options specifying integer size or real size can affect IFIX.

4For compatibility with older versions of Fortran, IFIX is treated as a generic function.

5Or JINT.

6The setting of compiler options specifying integer size can affect INT, IDINT, and IQINT.

7Or JIFIX.

8Or JIDINT. For compatibility with older versions of Fortran, IDINT can also be specified as a generic function.

9Or JIQINT. For compatibility with older versions of Fortran, IQINT can also be specified as a generic function.

10For compatibility, these functions can also be specified as generic functions.

If the argument is a binary, octal, or hexadecimal constant, the result is affected by the assume old-boz option. The default option setting, noold-boz, treats the argument as a bit string that represents a value of the data type of the intrinsic, that is, the bits are not converted. If setting old-boz is specified, the argument is treated as a signed integer and the bits are converted.

Example

INT (-4.2) has the value -4.

INT (7.8) has the value 7.

See Also