INT — Convert to integer type#
- INT(A , KIND))
Convert to integer type
- Parameters:
A – Shall be of type
INTEGER,REAL, orCOMPLEXor a boz-literal-constant.KIND – (Optional) An
INTEGERinitialization expression indicating the kind parameter of the result.
- Returns:
These functions return a
INTEGERvariable or array under the following rules:
- Standard:
Fortran 77 and later, with boz-literal-constant Fortran 2008 and later.
- Class:
Elemental function
- Syntax:
RESULT = INT(A [, KIND))
- Example:
program test_int integer :: i = 42 complex :: z = (-3.7, 1.0) print *, int(i) print *, int(z), int(z,8) end program
- Specific names:
Name
Argument
Return type
Standard
INT(A)REAL(4) AINTEGERFortran 77 and later
IFIX(A)REAL(4) AINTEGERFortran 77 and later
IDINT(A)REAL(8) AINTEGERFortran 77 and later