4 ms·
I might be making mistake (should go to sleep), but shouldn't the alternate formula be ((average * count) + x) / ++count, that is ++count instead of count++? T
by Tichy 18y ago
I might be making mistake (should go to sleep), but shouldn't the alternate formula be ((average * count) + x) / ++count, that is ++count instead of count++? Then I arrive at average += (x-average)/(count+1)