Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > standard variation

Reply
Thread Tools

standard variation

 
 
yanyo
Guest
Posts: n/a
 
      10-06-2005
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..!!

 
Reply With Quote
 
 
 
 
Alexei A. Frounze
Guest
Posts: n/a
 
      10-06-2005
"yanyo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
variation on (?) call subroutine by reference Alison Bowes Perl 0 02-18-2005 05:39 PM
Li-Ion batt for D70: vast variation in price MB Digital Photography 11 11-21-2004 03:34 PM
Severe Light Variation Bob Daun Digital Photography 4 08-05-2004 09:52 PM
Travelling salesman variation in python Erlend Andreas Garberg Python 20 04-02-2004 09:09 PM
New Sobig variation on the loose W32/Sobig.F-mm Lord Shaolin Computer Security 7 08-21-2003 11:04 PM



Advertisments