This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [offtopic] float vs. double?


nbecker@fred.net wrote:
> 
> Has anyone done any benchmarks of float vs. double performance on
> Pentium II?  Is there anything much to be saved by using float over
> double?

Although I haven't done any benchmarks, the general literature says that
using double is faster on modern CPU's.  The reason is that the hardware
does double precision calculations anyway.  This means that floats will
be converted to double, the calculation performed, and, finally, the
answer will be converted back to float (assuming no optimizations).

Noel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]