selected_real_kind

Date:

02-06-2023

NAME

SELECTED_REAL_KIND - Returns the real kind type parameter

SYNOPSIS

SELECTED_REAL_KIND ([[P=]p][,[R=]r][,[RADIX=]radix])

STANDARDS

Fortran

DESCRIPTION

The SELECTED_REAL_KIND intrinsic function returns the real kind type parameter of a real data type with decimal precision of at least p digits and a decimal exponent range of at least r. At least one of the following arguments must be present:

p

Must be scalar and of type integer.

r

Must be scalar and of type integer.

radix

Must be scalar and of type integer.

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

RETURN VALUES

This intrinsic function returns the real kind type parameter corresponding to the decimal precision and exponent range specified by its arguments. The result is a default integer scalar. The result has a value equal to a value of the kind type parameter of a real data type with decimal precision, as returned by the function PRECISION, of at least p digits and a decimal exponent range, as returned by the function RANGE, of at least r, or if no such kind type parameter exists, the result is -1 if the precision is not available, -2 if the exponent range is not available, -3 if neither is available, -4 if only one of the above is available, and -5 if radix is not supported. If more than one kind type parameter value meets the criteria, the value returned is the one with the smallest decimal precision, unless there are several such values, in which case the smallest of these kind values is returned.

SEE ALSO

models(3i)