Author: Dann Corbit
Date: 23:49:17 02/08/99
Go up one level in this thread
On February 09, 1999 at 02:43:52, Larry Griffiths wrote:
>I have been using Floating point (double) for my evaluation (scoring)
>function. I set some variables to 0.0 when starting the Alpha-Beta search.
>I add values to these variables when a move is made and then subtract them
>back out when restoreing the piece. I have found that the result is not
>always returned back to 0.0. I get something like 3.56234567343534-18.
>
>Should I be using integers for scoring instead?
print out the answers with something along the lines of:
printf("%.2f", ce);
which will show 0.00 for the example you gave. Subtraction is the most
catastrophic operation with floating point. Using integers is not always
faster, and sometimes can cause other unsuspected problems (e.g. 1.999 = 1).
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.