standard variation

Y

yanyo

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..!!
 
A

Alexei A. Frounze

yanyo said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top