> The logic in the second snippet is wrong (assuming the logic in the
> product method is what you want). Try it with [1,2], for example, and
> you'll get 2 for the first one and 5 for the second.
> 
> 
> David

Hi David,

Please bear with me as my brain is a bit fried - been working on a lot 
of complex issues all day long and so my mind is mush at this point.  I 
don't quite follow..

The method produces correct standard deviation results everytime..

a = [1,2,3,4,5]
b = [1,2]
c = [123.369, 68.6179]

stddev(a)
=> 1.58113883008419

stddev(b)
=> 0.707106781186548

stddev(c)
=> 38.7148740874228



-- 
Posted via http://www.ruby-forum.com/.