RANGE

The RANGE function returns a value that is equal to the value of the maximum argument minus the value of the minimum argument.

The function type depends on the argument types, as follows:

Argument Type Function Type
All arguments integer Integer
Numeric (some arguments can be integer) Numeric
Read syntax diagramSkip visual syntax diagram
Format

                      .------------.      
                      V            |      
>>-FUNCTION RANGE--(----argument-1-+--)------------------------><

argument-1
Must be class numeric.

The returned value is equal to argument-1 with the greatest value minus the argument-1 with the least value. The comparisons used to determine the greatest and least values are made according to the rules for simple conditions. For more information, see Conditional Expressions.

The equivalent arithmetic expression for the RANGE function is:
(FUNCTION MAX (argument-1) - FUNCTION MIN (argument-1))