Returns an accumulator function which incrementally computes a geometric mean.
accumulator function
var accumulator = incrgmean();
var v = accumulator();
// returns null
v = accumulator( 2.0 );
// returns 2.0
v = accumulator( 5.0 );
// returns ~3.16
v = accumulator();
// returns ~3.16
If provided a value, returns an updated geometric mean; otherwise, returns the current geometric mean.
Notes
NaN
or a value which, when used in computations, results inNaN
, the accumulated value isNaN
for all future invocations.NaN
for all future invocations.value
geometric mean