Description: | Converts a value to integer type. | ||
Class: | Elemental function; Generic | ||
Arguments: | A | Must be of type integer, real, or complex. | |
KIND (opt) | Must be a scalar integer initialization expression. | ||
Results: | The result
type is default integer. (If the processor cannot represent the
result in integer type, the result is undefined.) If KIND is
present, the kind parameter is that specified by KIND. If KIND is
not present, see the following table for the kind parameter.
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:
The setting of compiler options specifying integer size can affect this function. |
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) | |
IIFIX[2] | REAL(4) | INTEGER(2) |
IINT | REAL(4) | INTEGER(2) |
IFIX[3, 4] | REAL(4) | INTEGER(4) |
JFIX | INTEGER(1), INTEGER(2), INTEGER(4), REAL(4), REAL(8), COMPLEX(4), COMPLEX(8) | INTEGER(4) |
INT[5, 6] | REAL(4) | INTEGER(4) |
KIFIX | REAL(4) | INTEGER(8) |
KINT | REAL(4) | INTEGER(8) |
IIDINT | REAL(8) | INTEGER(2) |
IDINT[6, 7] | REAL(8) | INTEGER(4) |
KIDINT | REAL(8) | INTEGER(8) |
IIQINT | REAL(16) | INTEGER(2) |
IQINT[6, 8] | REAL(16) | INTEGER(4) |
KIQINT | REAL(16) | INTEGER(8) |
COMPLEX(4), COMPLEX(8) | INTEGER(2) | |
COMPLEX(4), COMPLEX(8) | INTEGER(4) | |
COMPLEX(4), COMPLEX(8) | INTEGER(8) | |
INT1 | INTEGER(1), INTEGER(2), INTEGER(4), REAL(4), REAL(8), COMPLEX(4), COMPLEX(8) | INTEGER(1) |
INT2 | INTEGER(1), INTEGER(2), INTEGER(4), REAL(4), REAL(8), COMPLEX(4), COMPLEX(8) | INTEGER(2) |
INT4 | INTEGER(1), INTEGER(2), INTEGER(4), REAL(4), REAL(8), COMPLEX(4), COMPLEX(8) | INTEGER(4) |
[1] These specific functions cannot be passed as actual
arguments.
|
Examples
INT (-4.2) has the value -4.
INT (7.8) has the value 7.