selected_int_kind

Date:

02-06-2023

NAME

SELECTED_INT_KIND - Returns an integer kind type parameter

SYNOPSIS

SELECTED_INT_KIND ([R=]r)

STANDARDS

Fortran

DESCRIPTION

The SELECTED_INT_KIND intrinsic function returns the kind type parameter of an integer data type that represents all integer values n with -10*r* < n < 10r. It accepts the following argument:

r

Must be scalar and of type integer.

SELECTED_INT_KIND is a transformational function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES

This intrinsic function returns the integer kind type parameter corresponding to the decimal exponent range specified by its argument. The result is a default integer scalar. The result has a value equal to the value of the kind type parameter of an integer data type that represents all values in the range of values -10*r* < n < 10r, or if no such kind type parameter exists, 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, unless there are several such values, in which case the smallest of these kind values is returned.

EXAMPLES

The SELECTED_INT_KIND intrinsic function generates the following results:

  • SELECTED_INT_KIND(4) yields 2.

  • SELECTED_INT_KIND(8) yields 4.

  • SELECTED_INT_KIND(13) yields 8.

  • SELECTED_INT_KIND(18) yields 8.

  • SELECTED_INT_KIND(19) yields -1.

For information on the integer number model, see the models(3i) man page.

SEE ALSO

models(3i)