"yanyo" <x_******@hotmail.com> wrote in message
news:eb******************************@localhost.ta lkaboutprogramming.com...
hi, im looking for a simple way to get the standard deviation and average
of integers inputed by a user.
i know theres a mathematical way "too long" to do it but i was wondering
if theres any shortcut
i read something about using "sd" but nothing too clear
your input will be appreciated..!!
That has as much to do with C as with any other programming language. That's
because what you're asking is a formula/algorithm. But this group isn't
about math and algorithms, it's about the _standard_ C programming language
(yes there's a standard for this language). And hence your STD is off topic
here.
The only thing I should warn you about is that the naive calculation of the
STD (using the classical math formula, which you'll find elsewhere) may
result in taking the square root of a negative value due to limited
precision of floating point numbers and operations. More on this and similar
problems you can find in Donald Knuth's The Art Of Computer Programming
book -- I don't have the volume, chapter and page numbers handy, however.
Alex