Author: Dieter Buerssner
Date: 15:02:38 02/20/05
Go up one level in this thread
On February 20, 2005 at 04:55:53, Sune Fischer wrote:
>On February 20, 2005 at 01:25:43, Dieter Buerssner wrote:
>>Seriously, I was too lazy. And it is a bit more work, than one might think,
>>because the counters that can count longer than ~4 billions are not that
>>universal ("portable").
>Why not use a double? [for a counter]
Indeed, that is a good idea. When I wrote the code of my engine, I did not think
about node counts of over 4 billions. It did less than 1000 nodes/s then. My
computer did not have a floating point processor, so all floating point usage
was really expensive. Standard C was rather vague about the details of floating
point issues/accuracy. At the moment IEEE Standard floating point seems to be
guaranteed. It will guarantee good working counters up to 2^^53 when using
double as a counter. But when you already have that "long node_counter" it still
needs a lot of changes, to make it "double node_counter". All the printf format
strings must be changed, some other things, too. See my first sentence above "
... too lazy". It can introduce more and more severe bugs. When we hit 2^^53,
counter +=1 will not change counter anymore. When you have code that compares
counters (say every millisecond) with the old overflowing unsigned long counter,
oldcounter-newcounter would still yield a usable result, while with a double
counter, after a while, it will always be zero (computers are not fast enough
yet, for this problem to arise. )
Cheers,
Dieter
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.