SELECTED_REAL_KIND

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

Syntax

result = SELECTED_REAL_KIND ([p] [, r])

p
(Input; optional) Must be scalar and of type integer.

r
(Input; optional) Must be scalar and of type integer.

Results

The result is a scalar of type default integer. If both arguments are absent, the result is zero. Otherwise, the result has a value equal to a value of the kind 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.

If no such kind type parameter is available on the processor, the result is as follows:

   -1 if the precision is not available
   -2 if the exponent range is not available
   -3 if neither is available

If more than one kind type parameter value meets the criteria, the value returned is the one with the smallest decimal precision. For more information, see Model for Real Data.

See Also

SELECTED_INT_KIND

Examples

SELECTED_REAL_KIND (6, 70) = 8

The following shows another example:

 i = SELECTED_REAL_KIND(r=200)  ! returns 8
 i = SELECTED_REAL_KIND(13)     ! returns 8