IncrementalAverage.addToAverage

Adds a new number (giving it an appropriate weight) to the average.

Note that if too many numbers were added (more than ulong.max) then the the internal counter will overflow (and as a result the average value would be corrupt).

struct IncrementalAverage
void
addToAverage
(
T
)
(,
ulong count = 1
)

Parameters

value T

the new value to add to the current average.

count ulong

if that value represent in itself the average of other numbers, then this param should define the number of elements that this average stands for. A count = 0 has no effect on the average and gets discarded.

Meta