DEV Community

Discussion on: Calculating mean iteratively

Collapse
 
paddy3118 profile image
Paddy3118 • Edited

The normal way is to keep a count of, and the sum of, the numbers so far. The sum divided by the count is the mean at any point
Further statistics can calculate other values in a similar way, such as standard deviations.