Y
Hacker News
new
|
ask
|
show
|
jobs
by
Boxer
6246 days ago
Let average-so-far=a, count=c. When you add a new item x, the new average is: a = a + (x-a)/(c+1)