Question: I need to know if a number compared to a set of numbers is outside of 1 stddev from the mean, etc..

Answer: 
You can avoid making two passes over the data by accumulating the mean and mean-square

```
cnt = 0
mean = 0
meansqr = 0
loop over array
    cnt++
    mean += value
    meansqr += value*value
mean /= cnt
meansqr /= cnt

```

and forming

```
sigma = sqrt(meansqr - mean^2)

```

A factor of `cnt/(cnt-1)` is often appropriate as well.

BTW-- The first pass over the data in [Demi](https://stackoverflow.com/questions/895929/how-do-i-determine-the-stddev-of-a-set-of-values/896070#896070) and [McWafflestix](https://stackoverflow.com/questions/895929/how-do-i-determine-the-stddev-of-a-set-of-values/895939#895939) answers are hidden in the calls to `Average`. That kind of thing is certainly trivial on a small list, but if the list exceed the size of the cache, or even the working set, this gets to be a bid deal.
This is Population standard deviation

```
private double calculateStdDev(List<double> values)
{
    double average = values.Average();
    return Math.Sqrt((values.Select(val => (val - average) * (val - average)).Sum()) / values.Count);
}

```

For Sample standard deviation, just change [values.Count] to [values.Count -1] in above code.

Make sure you don't have only 1 data point in your set.