[gameprogrammer] Re: floating point vs fixed

I have nothing to really back up my opinions but from other
discussions I've read and information I've come across...

You don't gain a whole lot by going fixed point over floating point
other than perhaps higher accuracy in the limited number range you
are playing with.  Floats have issues with accuracy when you are
playing on the edges of the 6 significant digits that it can reliably
define.

Most modern processors will handle float operations on par with any
fixed point implementation you'll come up with; possibly be even
faster.  So speed wise you won't see much benefit.  With the
processor caches and such, it's become faster to have the processor
calculate the sin/cos and whatever other number functions instead of
keeping pre-computed tables (main memory cache misses when having to
fetch the right table value)

Fixed point was the name of the game during the 8086-80386 era
because they didn't really have (much) memory caches for instructions
or data.  Plus floating point calcs were really slow compared to
integer calcs.  Now, it's pretty much the inverse. 

For the most part you can believe that the processors will behave
realtively the same no matter which processor you use.  The
differences will not be significant enough to worry about IMO.  They
all use the same IEEE format for floats so should be pretty much the
same.  (Yeah, yeah, nothing is ever exact with floats.)  I wouldn't
worry too much about it though.

--- Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:

> Hey Guys,
> 
> I'm making a PC game that has some physics simulation stuff in it,
> and
> we are using floating point numbers.
> 
> In retrospect I know I should have used fixed point because of the
> differences in the floating point tables on different CPU's but I
> was
> wondering if anyone knows just how significant a problem this might
> be?
> 
> Are the floating point tables different enough on different CPUs to
> be
> worried that a simulation would run substantially different on
> different systems?
> 
> Any tips to curb this problem besides switching to fixed point?


Robbert de Groot


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: