Intel® Fortran Compiler 18.0 Developer Guide and Reference

SELECTED_INT_KIND

Transformational Intrinsic Function (Generic): Returns the value of the kind parameter of an integer data type.

result = SELECTED_INT_KIND (r)

r

(Input) Must be scalar and of type integer.

Results

The result is a scalar of type default integer. The result has a value equal to the value of the kind parameter of the integer data type that represents all values n in the range of values n with -10 r< n < 10 r.

If no such kind type parameter is available on the processor, the result is -1. If more than one kind type parameter meets the criteria, the value returned is the one with the smallest decimal exponent range. For more information, see Model for Integer Data.

Example

SELECTED_INT_KIND (6) = 4

The following shows another example:

 i = SELECTED_INT_KIND(8)  ! returns 4
 i = SELECTED_INT_KIND(3)  ! returns 2
 i = SELECTED_INT_KIND(10) ! returns 8
 i = SELECTED_INT_KIND(20) ! returns -1 because 10**20
                           !   is bigger than 2**63

See Also