VividCortex/ewma — pull request #2 by ickymettle (2013-09-02 14:36:32+00:00)
Title: fix off by one error in VariableEWMA.Value() return

Fixes an off by one issue when returning values for VariableEWMA.

For example if `WARMUP_SAMPLES == 10`, e.count gets incremented postfix in VariableEWMA.Add() the conditional in VariableEWMA.Value() would return the current e.value (sum of samples seen) on the 9th iteration rather than 0.0.

This corrects the behaviour with the 10th iteration returning the mean of first 10 samples as expected.