Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Floating point VS Integer Math.

Author: David Blackman

Date: 21:31:19 05/14/98

Go up one level in this thread


On May 14, 1998 at 21:35:52, Ivan Tirado wrote:

>  Ok. So in *normal* micros integer math dominates. Is this necessarily
>so? Are you SURE? I do some programming myself, and I remember that the
>Glide reference manual ( 3DFX graphics ) states that it uses floating
>point math in its library: ( I paraphrase now ) "...because it is MUCH
>faster in pentiums..". Was 3DFX wrong when it wrote this? Or am I
>confusing something here? ( i.e. is FIXED POINT math == integer math ??

Floating point multiply is faster than integer multiply on a lot of
modern
cpus, probably including the pentium. Floating divide is sometimes
faster than
integer divide too.

However floating point add, subtract and compare will be slower than
integer add, subtract and compare on just about anything. The inside
loops of chess programs tend to do a lot of add, subtract and compare,
but very little multiply and divide. So integer arithmetic is probably
the best choice for chess. It would be different for graphics.

Fixed point is nearly the same as integer. You use integers but pretend
there
is a binary point at some fixed place inside the number. You can do
normal
integer add and subtract for fixed point. For fixed point multiply or
divide you do an integer multiply or divide followed by a shift.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.