This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [offtopic] float vs. double?
- To: nbecker at fred dot net
- Subject: Re: [offtopic] float vs. double?
- From: Noel Yap <nyap at garban dot com>
- Date: Tue, 04 Aug 1998 07:46:16 -0400
- CC: egcs at cygnus dot com
- Organization: Garban LLC
- References: <E0z3R3w-00007D-00@hns.com>
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