repl.txt (863B)
1 2 {{alias}}() 3 Returns an accumulator function which incrementally computes a mid-range. 4 5 The mid-range is the arithmetic mean of maximum and minimum values. 6 Accordingly, the mid-range is the midpoint of the range and a measure of 7 central tendency. 8 9 If provided a value, the accumulator function returns an updated mid-range. 10 If not provided a value, the accumulator function returns the current mid- 11 range. 12 13 If provided `NaN`, the mid-range is `NaN` for all future invocations. 14 15 Returns 16 ------- 17 acc: Function 18 Accumulator function. 19 20 Examples 21 -------- 22 > var accumulator = {{alias}}(); 23 > var v = accumulator() 24 null 25 > v = accumulator( 3.14 ) 26 3.14 27 > v = accumulator( -5.0 ) 28 ~-0.93 29 > v = accumulator( 10.1 ) 30 2.55 31 > v = accumulator() 32 2.55 33 34 See Also 35 -------- 36