delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/05/02:44:41

Message-ID: <32F8387D.6210@eik.bme.hu>
Date: Wed, 05 Feb 1997 08:36:29 +0100
From: "DR. Andras Solyom" <solyom AT eik DOT bme DOT hu>
Reply-To: solyom AT eik DOT bme DOT hu
Organization: Technical University of Budapest
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: floats v doubles myth
References: <199702050444 DOT OAA21257 AT solwarra DOT gbrmpa DOT gov DOT au>

Leath Muller wrote:
> 
> Ok, lets try again... :)
> 
> > > Can we *please* kill this myth.
> > > On Pentium there is NO speed difference between using a float or double.
> > > On 387,486/487 float is slightly *faster* to load, store or read from
> > > ram as an operand, than a double.
> 
> > Myth ? which myth? This is true.
> > Try this :
> 
> Its not a myth... see the following...
> 
> [big snip...]
> 
> > On my 486dx75, this program prints "20 12", which means the calculation
> > in floats is about twice slower than the calculation in doubles.
> 
> 
> Don't take this badly or the wrong way or anything, I say this nicely:
> If you don't have a pentium, don't say anthing. :)  Its REALLY REALLY
> simple.
> 
> ON THE PENTIUM: ALL FLOATS AND DOUBLES ARE CONVERTED TO 80 BIT VALUES
> BY THE FPU BEFORE THE CALCULATION, CALCULATED IN 80 BIT, AND THEN STORED
> IN ITS ORIGINAL RESOLUTION (FLOAT/DOUBLE). THIS TAKES *NO* TIME ON A
> PENTIUM.
> 
Just for fun:
	I have checked the code of Francois Charton on my P100 system
	it printed: 30 21

        your code produced a GPF under Win95's in the DOS window

						Andras

- Raw text -


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