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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

double vs. float

  • 17-04-2004 3: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, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


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


  • Registered Users, Registered Users 2 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