Minor crafty bug

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Minor crafty bug

Post by jwes »

If you define HASHSTATS, then the code that prints the hash table saturation can overflow if the hash table is at least 384M in size.

used * 100 / (3 * hash_table_size + 1));

could be changed to

(BITBOARD) used * 100 / (3 * hash_table_size + 1));
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Minor crafty bug

Post by bob »

jwes wrote:If you define HASHSTATS, then the code that prints the hash table saturation can overflow if the hash table is at least 384M in size.

used * 100 / (3 * hash_table_size + 1));

could be changed to

(BITBOARD) used * 100 / (3 * hash_table_size + 1));
I am not sure why it will overflow and why the (BITBOARD) will fix it, since used * 100 ends up a 64 bit value on 32 bit systems, but I will make the change to be safe...