1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Difference between float and double?

Discussion in 'C' started by winten, Sep 2, 2010.

  1. winten

    winten New Member

    Joined:
    Sep 2, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I have assignment to build quadratic equation roots calculator, and i was wondering what was the difference between float and double.

    For example

    int a, b , c = 1;
    float x1, x2, d;

    d = (float)b*b - 4*a*c;

    Or:

    int a, b , c = 1;
    double x1, x2, d;
    d = b*b - 4*a*c;


    What is the difference between them?
     
  2. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    17
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    u wnt be able to judge the difference as long as u get fraction calculations of lower precision..we can say double as a long float.
     

Share This Page