range

Date:

02-06-2023

NAME

RANGE - Returns the decimal exponent range of a number according to the real or integer model

SYNOPSIS

RANGE ([X=]x)

STANDARDS

Fortran

DESCRIPTION

The RANGE intrinsic function returns the decimal exponent range in the model representing integer or real numbers with the same kind type parameter as the argument. For information on integer number model or the real number model, see the models(3i) man page. It accepts the following argument:

x

Must be of type INTEGER, REAL, or COMPLEX. It may be scalar or array valued.

RANGE is an inquiry function. The name of this intrinsic cannot be passed as an argument.

RETURN VALUES

The result is a default INTEGER scalar.

For an integer argument, the result has the value INT(LOG10(huge)), where huge is the largest positive integer in the model representing integer numbers with same kind type parameter as x.

For a REAL or COMPLEX argument, the result has the value INT(MIN(LOG10(huge),-LOG10(tiny))), where huge and tiny are the largest and smallest positive numbers in the model representing real numbers with the same value for the kind type parameter as x.

SEE ALSO

models(3i)