delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/29/19:48:02

From: jlouwere AT galaxy DOT csc DOT calpoly DOT edu (Jan Louwerens)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: doubles vs. floats
Date: 29 Jan 1997 16:53:10 GMT
Organization: Cal Poly Computer Science Dept.
Lines: 17
Message-ID: <5cnv9m$c6c@waldorf.csc.calpoly.edu>
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>
NNTP-Posting-Host: galaxy.csc.calpoly.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

sci/econ/15305 <wpenros comp.os.msdos.djgpp:12480

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

- Raw text -


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