INT

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

Syntax

result = INT (a [, kind])

a
(Input) Must be of type integer, real, or complex.

kind
(Optional; input) Must be a scalar integer initialization expression.

Results:

The result is of type 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 affect as the implied conversion in assignment statements.

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

Specific Name1 Argument Type 2 Result Type
  INTEGER(1), INTEGER(2), INTEGER(4) INTEGER(4)
  INTEGER(1), INTEGER(2), INTEGER(4),
INTEGER(8)
INTEGER(8)
IIFIX 3 REAL(4) INTEGER(2)
IINT REAL(4) INTEGER(2)
IFIX 4, 5 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 6, 7 REAL(4) INTEGER(4)
KIFIX REAL(4) INTEGER(8)
KINT REAL(4) INTEGER(8)
IIDINT REAL(8) INTEGER(2)
IDINT 7, 8 REAL(8) INTEGER(4)
KIDINT REAL(8) INTEGER(8)
IIQINT REAL(16) INTEGER(2)
IQINT 7, 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)
INT1 INTEGER(1), INTEGER(2), INTEGER(4),
INTEGER(8), REAL(4), REAL(8), REAL(16),
COMPLEX(4), COMPLEX(8), COMPLEX(16)
INTEGER(1)
INT2 INTEGER(1), INTEGER(2), INTEGER(4),
INTEGER(8), REAL(4), REAL(8), REAL(16),
COMPLEX(4), COMPLEX(8), COMPLEX(16)
INTEGER(2)
INT4 INTEGER(1), INTEGER(2), INTEGER(4),
INTEGER(8), REAL(4), REAL(8), REAL(16),
COMPLEX(4), COMPLEX(8), COMPLEX(16)
INTEGER(4)
INT8 INTEGER(1), INTEGER(2), INTEGER(4),
INTEGER(8), REAL(4), REAL(8), REAL(16),
COMPLEX(4), COMPLEX(8), COMPLEX(16)
INTEGER(8)
1 These specific functions cannot be passed as actual arguments.
2 REAL(16) and COMPLEX(16) are only available on OpenVMS, Tru64 UNIX, and Linux systems.
3 This function can also be specified as HFIX.
4 The setting of compiler option /integer_size or /real_size can affect IFIX.
5 For compatibility with older versions of Fortran, IFIX can also be specified as a generic function.
6 Or JINT.
7 The setting of compiler option /integer_size can affect INT, IDINT, and IQINT.
8 Or JIDINT. For compatibility with older versions of Fortran, IDINT can also be specified as a generic function.
9 Or JIQINT. For compatibility with older versions of Fortran, IQINT can also be specified as a generic function.

Compatibility

CONSOLE STANDARD GRAPHICS QUICKWIN GRAPHICS WINDOWS DLL LIB

See Also: NINT, AINT, ANINT, REAL, DBLE, SNGL

Examples

INT (-4.2) has the value -4.

INT (7.8) has the value 7.