repl.txt (847B)
1 2 {{alias}}() 3 Returns an accumulator function which incrementally computes a sum of 4 squared absolute values. 5 6 If provided a value, the accumulator function returns an updated sum. If not 7 provided a value, the accumulator function returns the current sum. 8 9 If provided `NaN` or a value which, when used in computations, results in 10 `NaN`, the accumulated value is `NaN` for all future invocations. 11 12 For long running accumulations or accumulations of large numbers, care 13 should be taken to prevent overflow. 14 15 Returns 16 ------- 17 acc: Function 18 Accumulator function. 19 20 Examples 21 -------- 22 > var accumulator = {{alias}}(); 23 > var s = accumulator() 24 null 25 > s = accumulator( 2.0 ) 26 4.0 27 > s = accumulator( -5.0 ) 28 29.0 29 > s = accumulator() 30 29.0 31 32 See Also 33 -------- 34