range ( seq -- x )
Statistics
Prev:var-ddof ( seq n -- x )
Next:minmax ( seq -- min max )


Vocabulary
math.statistics

Inputs and outputs
seqa sequence
xa non-negative real number


Word description
Computes the difference of the maximum and minimum values in seq.

Examples
USING: math.statistics prettyprint ; { 1 2 3 } range .
2

USING: math.statistics prettyprint ; { 1 2 3 4 } range .
3


Definition
USING: kernel math ;

IN: math.statistics

: range ( seq -- x ) minmax swap - ;