delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/15/08:26:53

Reply-To: <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>
Subject: RE: Floating/fixed point
Date: Sun, 13 Sep 1998 14:15:45 +0100
Message-ID: <000101bddf18$9db5fa00$d54b08c3@arthur>
MIME-Version: 1.0
In-Reply-To: <35FA9D74.E138AD72@unb.ca>
Importance: Normal

> Arthur wrote:
> > Although floating point math is just as fast as integer math on
> a Pentium,
> > it sucks on anything less than a Pentium, on any AMD processor
> (apart from
> > the K6-2) and any Cyrix processor (apart from the Cyrix MediaGX
> chip). Also
> > conditionals and integer-float conversion are unfeasibly slow
> on any chip.
> 	I don't know where you got your info, but floating point
> math is MUCH slower
> than int's even on a Pentium.  Pentium's do floating point math
> much faster
> than 486/387 chips did, but they are still slower than integer.
> You can't add
> 2 floats in 1 clock cycle.

Are you sure you're using the FPU? Are you sure you're using a genuine
Intel? Besides, the real difference is in multiplications, divisions and
trigonomic functions, which are quite a bit faster than integer math on a
standard Pentium. On a PII, the FPU is generally the same as a Pentium, but
integer math is improved quite a bit over a Pentium.

> > However, a 32-bit float (32.32) is much more accurate than a
> 32-bit (16.16)
> > fixed number.
> 	That is very misleading (or wrong).  32-bit float's (also
> known as double's)
> aren't 32.32.  You make it sound like there are 32 bits before
> the decimal and
> 32 bits after (9 digits.9 digits).  double's are 12 digits of
> precision with a
> base 10 exponent that can range from +-308.

Sorry, I was harking back to my Motorola days where a basic float was 32
bits before the decimal and 32 bits after (encoded in two longwords). But
this just goes further to prove my point that floating point has a higher
precision than fixed point math.

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

- Raw text -


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