delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/30/01:10:05

From: Joe Wright <wrightj AT exis DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: doubles vs. floats
Date: Wed, 29 Jan 1997 12:37:56 -0800
Organization: Alpha Solutions International
Lines: 25
Message-ID: <32EFB524.37FA@exis.net>
References: <Pine DOT GSO DOT 3 DOT 95 DOT 970128011210 DOT 27048A-100000 AT hops DOT cs DOT jhu DOT edu> <32EEA01D DOT 700E AT bc DOT sympatico DOT ca> <5cnv9m$c6c AT waldorf DOT csc DOT calpoly DOT edu>
Reply-To: wrightj AT exis DOT net
NNTP-Posting-Host: ppp-5-145.exis.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019