I'm pretty sure this is correct. Proof is left as an exercise to the reader (it's fairly simple) :-), but to motivate that this might be correct:

    $ python
    Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
    [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import random
    >>> samples = [random.random() for _ in range(40)]
    >>> N = float(len(samples))
    >>> avg = float(sum(samples)) / N
    >>> varsum = 0.0;
    >>> for dt in samples:
    ...     varsum = varsum + (float(dt) - avg)**2
    ... 
    >>> import math
    >>> dev = math.sqrt(varsum / N)
    >>> dev2 = math.sqrt(sum([t*t for t in samples])/N - avg * avg)
    >>> dev2
    0.28588578903142275
    >>> dev
    0.2858857890314226
    >>> dev - dev2
    -1.6653345369377348e-16