Returns an accumulator function which incrementally computes a sum of products.
accumulator function
var accumulator = incrsumprod();
var v = accumulator();
// returns null
v = accumulator( 2.0, 3.0 );
// returns 6.0
v = accumulator( -5.0, 2.0 );
// returns -4.0
v = accumulator();
// returns -4.0
If provided arguments, returns an updated sum of products; otherwise, returns the current sum of products.
Notes
NaN
or a value which, when used in computations, results inNaN
, the accumulated value isNaN
for all future invocations.value
value
sum of products