Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

double vs. float

Options
  • 17-04-2004 4:34pm
    #1
    Closed Accounts Posts: 17


    In C++, ignoring memory differences, will a program using floats run significantly faster than one using doubles?????

    bostitch


Comments

  • Closed Accounts Posts: 256 ✭✭$lash


    no .. even for large programs its only very slight .. the only real difference is the amount of memory used..


  • Closed Accounts Posts: 437 ✭✭casper-


    Originally posted by $lash
    no .. even for large programs its only very slight .. the only real difference is the amount of memory used..

    Well...the real difference is the precision change, and for the most part you should just always stick to double imho.


  • Closed Accounts Posts: 17 Bostitch


    Cheers,
    thats the answer i was hoping for!
    Bostitch.


  • Registered Users Posts: 4,003 ✭✭✭rsynnott


    And in fact, under certain circumstances, Double speed may even beat float!


  • Registered Users Posts: 491 ✭✭Silent Bob


    Originally posted by $lash
    no .. even for large programs its only very slight .. the only real difference is the amount of memory used..
    This is plainly not true.

    It depends what you are doing with the program. I wrote a program a while back that had to do fast-fourier transforms to a 2d array of floating point numbers. The program increased in speed by about 60% when I switched from doubles to floats.

    Yes FFT's are quite intensive, but it just goes to show.


  • Advertisement
Advertisement