Re: float vs. double?
- From: "Jeff F" <no-reply@xxxxxxxxxxxxx>
- Date: Thu, 21 Dec 2006 15:37:08 -0500
Joseph M. Newcomer wrote:
There have been repeated myths that float is faster than double. In
antique machines, the kind where you could see the transistors
without a microscope, this was true. It has not been true in the
Pentium series in many years. A floating-point multiply takes, if I
recall correctly, one CPU clock cycle, that is, about 1/3ns on a 3GHz
machine. And it will happen concurrently with two other integer
operations. So there's very little motivation to use 'float' these
days.
Not that I'm promoting it, but obviously it takes half of the storage to
store float's versus double. In a realtime mechanical dynamic simulation
package that we profiled, it was well worth the improved cache hits, and
reduced communication bandwidth to deal in floats. Also, IIRC, early MMX or
was it SSE were limited to floats.
Jeff Flinn
.
- Follow-Ups:
- Re: float vs. double?
- From: Joseph M . Newcomer
- Re: float vs. double?
- References:
- float vs. double?
- From: Robert Wong
- Re: float vs. double?
- From: David Webber
- Re: float vs. double?
- From: Robert Wong
- Re: float vs. double?
- From: David Webber
- Re: float vs. double?
- From: Joseph M . Newcomer
- float vs. double?
- Prev by Date: Re: Change the size of the dropdown list in CComboBox
- Next by Date: Vista UAC
- Previous by thread: Re: float vs. double?
- Next by thread: Re: float vs. double?
- Index(es):