RANGE(X)

Purpose

Returns the decimal exponent range in the model representing integer or real numbers with the same kind type parameter as the argument.

Class

Inquiry function

Argument Type and Attributes

X
must be of type integer, real, or complex. It may be scalar or array valued.

Result Type and Attributes

Default integer scalar.

Result Value

  1. For an integer argument, the result is:
    INT( LOG10( HUGE(X) ) )
    
  2. For a real or complex argument, the result is:
    INT( MIN( LOG10( HUGE(X) ), -LOG10( TINY(X) ) ) )
    

+-------------------------------IBM Extension--------------------------------+

Thus:

Type                     RANGE
------------------------------
integer(1)                  2
integer(2)                  4
integer(4)                  9
integer(8)                 18
real(4) , complex(4)       37
real(8) , complex(8)      307
real(16) , complex(16)    291

+----------------------------End of IBM Extension----------------------------+

Examples

+-------------------------------IBM Extension--------------------------------+

X is of type real(4):

HUGE(X) = 0.34E+39
TINY(X) = 0.11E-37
RANGE(X) = 37

+----------------------------End of IBM Extension----------------------------+

See Data Representation Models. IBM Copyright 2003