Skip to content

Commit

Permalink
Merge pull request #432 from tmcgannon/master
Browse files Browse the repository at this point in the history
[Fix] Corrects calculation of t.Med in stats output
  • Loading branch information
liclac committed Dec 19, 2017
2 parents c94a32b + 8e45337 commit c0b64a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stats/sink.go
Expand Up @@ -136,7 +136,7 @@ func (t *TrendSink) Calc() {

// The median of an even number of values is the average of the middle two.
if (t.Count & 0x01) == 0 {
t.Med = (t.Med + t.Values[(t.Count/2)-1]) / 2
t.Med = (t.Values[(t.Count/2)-1] + t.Values[(t.Count/2)]) / 2
} else {
t.Med = t.Values[t.Count/2]
}
Expand Down

0 comments on commit c0b64a7

Please sign in to comment.