Mail Archives: djgpp/1997/01/30/01:10:05
Jan Louwerens wrote:
>
> Ryan Blazecka (eblazecka AT bc DOT sympatico DOT ca) wrote:
> : Michael Phelps wrote:
>
> : > This may sound a little counterintuitive, but sometimes you can get better
> : > results by using doubles rather than floats.
>
> : Why is this? I've heard it many times, but never understood why.
>
> Yes, this is true. It is because every float is is converted into a
> double before every operation and is then converted back into a float at
> the end of the operation. (FPU only handles double, not float? I'm not
> sure). If you want speed, use all doubles instead of floats. For size,
> use floats.
>
> JL
Yes, it's true. double is better than float in every conceivable way.
I don't even think the size argument has any validity unless you have
a really massive number of them. Anyway, memory is cheaper than time.
And double is significantly more accurate and precise.
--
Joe Wright mailto:wrightj AT exis DOT net
"Everything should be made as simple as possible, but not simpler."
--Albert Einstein--
- Raw text -