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:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    http://www.techgeek.in
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice