Calculating standard deviations using the (x-mu)^2/(n-1) formula is inherently a two-pass algorithm, one pass to find mu, and then another to calculate and add the (x-mu)^2 bits. (This is why no one...
Type: Posts; User: tabstop
Calculating standard deviations using the (x-mu)^2/(n-1) formula is inherently a two-pass algorithm, one pass to find mu, and then another to calculate and add the (x-mu)^2 bits. (This is why no one...
That's the one I was looking at, yes.
total=0;
avg = total/count;
Why are you computing avg before you've even read the numbers in? It will always be zero.