Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: perft position

Author: Alessandro Scotti

Date: 14:32:07 10/02/04

Go up one level in this thread


On October 02, 2004 at 09:24:57, Roman Hartmann wrote:

>On October 02, 2004 at 09:08:36, Reinhard Scharnagl wrote:
>
>>On October 02, 2004 at 08:51:34, Roman Hartmann wrote:
>
>>Well, 0x8A8D67B6 exeeds the range of a signed 4 byte integer.
>>Up to level 80 it might help to use unsigned counters, obove from
>>that level you will need 8 byte counters like Smirf is using here.
>>
>>Reinhard.
>
>Hello Reinhard,
>I'm using long int for perft so that shouldn't be the problem.
>But I just figured out that I was using printf("\nPerft %d: %d (%2.2f)", depth,
>upper-lower ...) instead of printf("\nPerft %d: %u (%2.2%f)", depth, upper-lower
>...) :)

That will buy you an extra bit, but in the most common 32-bit platforms
sizeof(long) is same as sizeof(int). In fact it's for this reason that in the
above printf() you can get away with using "%d" or "%u" without adding the "l"
size prefix (e.g. using "%ld" or "%lu").
You must use something like "long long" (GCC) or "__int64" (MSVC) to get 8 bytes
integers.



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.