delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/29/17:15:36

Message-ID: <32EFC7D8.64A@pobox.oleane.com>
Date: Wed, 29 Jan 1997 22:57:44 +0100
From: Francois Charton <deef AT pobox DOT oleane DOT com>
Organization: CCMSA
MIME-Version: 1.0
To: eblazecka AT bc DOT sympatico DOT ca
CC: djgpp AT delorie DOT com
Subject: Re: doubles vs. floats
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>

Ryan Blazecka 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.

On PC with FPU, all float calculations are done in double precision, so 
when you do something on a float, your machine will sometimes :

1/ cast it to double
2/ do the computation in double
3/ cast the result to float...

Hence the loss in speed... 

Francois

- Raw text -


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