floating point calculation problem

Discussion in 'C++' started by bei, Jan 6, 2010.

  1. bei

    bei Guest

    Hello,

    I was bothered by the following problem for a while and could not
    understand how it happened.

    Basically, i am doing an interpolation from a random position to the
    closest grid point position. They are a lot of
    floating point calculation in the code. Below is a part of the code
    that resulted in large errors:


    q0 = 1.0-2.5*pow(((v/dv+(N-0.5))-j0), 2.0)+1.5*pow(((v/dv+(N-0.5))-
    j0), 3.0);
    bei, Jan 6, 2010
    #1
    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. bei
    Replies:
    4
    Views:
    381
  2. Saraswati lakki
    Replies:
    0
    Views:
    1,317
    Saraswati lakki
    Jan 6, 2012
  3. Hyun chul Park

    Floating point calculation problem

    Hyun chul Park, Jul 8, 2008, in forum: Ruby
    Replies:
    3
    Views:
    106
    Axel Etzold
    Jul 8, 2008
  4. Chris Angelico

    Re: Floating point calculation problem

    Chris Angelico, Feb 2, 2013, in forum: Python
    Replies:
    16
    Views:
    232
    Michael Torrie
    Feb 3, 2013
  5. Chris Rebert

    Re: Floating point calculation problem

    Chris Rebert, Feb 2, 2013, in forum: Python
    Replies:
    0
    Views:
    107
    Chris Rebert
    Feb 2, 2013
Loading...

Share This Page