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.
```
/// <summary>
/// Calculates standard deviation, same as MATLAB std(X,0) function
/// <seealso cref="http://www.mathworks.co.uk/help/techdoc/ref/std.html"/>
/// </summary>
/// <param name="values">enumumerable data</param>
/// <returns>Standard deviation</returns>
public static double GetStandardDeviation(this IEnumerable<double> values)
{
    //validation
    if (values == null)
        throw new ArgumentNullException();

    int lenght = values.Count();

    //saves from devision by 0
    if (lenght == 0 || lenght == 1)
        return 0;

    double sum = 0.0, sum2 = 0.0;

    for (int i = 0; i < lenght; i++)
    {
        double item = values.ElementAt(i);
        sum += item;
        sum2 += item * item;
    }

    return Math.Sqrt((sum2 - sum * sum / lenght) / (lenght - 1));
}

```