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

To: djgpp AT delorie DOT com
Subject: Re: doubles vs. floats
Message-ID: <19970129.150806.4951.1.chambersb@juno.com>
References: <Pine DOT GSO DOT 3 DOT 95 DOT 970128011210 DOT 27048A-100000 AT hops DOT cs DOT jhu DOT edu>
From: chambersb AT juno DOT com (Benjamin D Chambers)
Date: Wed, 29 Jan 1997 18:07:30 EST

On Tue, 28 Jan 1997 16:55:57 -0800 Ryan Blazecka
<eblazecka AT bc DOT sympatico DOT ca> writes:
>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.
>
Because the FPU only works with doubles.  So to use floats, you have to
go through conversions such as:
float->double->float
Which can get rather slow if you use enough.  The only good argument for
floats is that they don't use as much memory, but a few bytes probably
won't make much difference IMHO.

...Chambers

- Raw text -


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