does anyone know why i might be getting different results to these commercially available applications?
Are you suffering from numerical round-off problems? How many elements are in the array? How big are the individual elements compared to $sum and $sumsq? One way to test for numerical errors is to plot a graph of the standard deviation for various numbers of $elements. If the graph looks like it converges to a value, you're OK, but if the answer plot starts to "get fuzzy" (i.e. more random) you probably have problems.