www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/25/13:15:18

From: idr AT cs DOT pdx DOT edu (Ian D Romanick)
Message-Id: <199606251703.KAA05533@sirius.cs.pdx.edu>
Subject: Re: Fixed point math
To: svincent AT zippy DOT sonoma DOT edu (Samuel Vincent)
Date: Tue, 25 Jun 1996 10:03:09 -0700 (PDT)
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.GSO.3.94.960625013434.2111A-100000@zippy> from "Samuel Vincent" at Jun 25, 96 01:35:40 am
MIME-Version: 1.0

> I am curious.  Is there any reason long long ints are not used for fixed
> point math?  It would provide 64 bits of precision..  Making a 32.32
> possible...

It would be slow as hell.  To do on 32x32 multiply it takes *4* multiply
instructions.  It would be faster to convert it to float, do the
multiply, and convert it back to an integer.  Doing 16.16 requires only
one multiply.  Same rules apply for division.

-- 
"The trick is to forget about writing something good and pull cheese
out of your butt." -- Necros, on how to win the '20-Minutes' compo

Visit the Epsilon Coder Page at http://www.cs.pdx.edu/~idr

- Raw text -


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