standard variation

Discussion in 'C Programming' started by yanyo, Oct 6, 2005.

  1. yanyo

    yanyo Guest

    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..!!
    yanyo, Oct 6, 2005
    #1
    1. Advertising

  2. "yanyo" <> wrote in message
    news:...
    > 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
    Alexei A. Frounze, Oct 6, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alison Bowes
    Replies:
    0
    Views:
    466
    Alison Bowes
    Feb 18, 2005
  2. Erlend Andreas Garberg

    Travelling salesman variation in python

    Erlend Andreas Garberg, Apr 1, 2004, in forum: Python
    Replies:
    20
    Views:
    4,163
    G√ľnter Jantzen
    Apr 2, 2004
  3. j0mbolar

    opinions on logical OR variation

    j0mbolar, Sep 28, 2004, in forum: C Programming
    Replies:
    3
    Views:
    303
    Tim Rentsch
    Sep 29, 2004
  4. Replies:
    0
    Views:
    1,242
  5. Eric
    Replies:
    5
    Views:
    352
    Luke Meyers
    Feb 19, 2006
Loading...

Share This Page