Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Is there an advantage for using unsigned 64 bit integers for hash?

Author: Ricardo Gibert

Date: 19:02:04 09/11/03

Go up one level in this thread


On September 11, 2003 at 08:03:13, Uri Blass wrote:

>My natural choice is not to use unsigned for varaibles if there is no special
>reasons.


I have the reverse preference, because:

1 - Sometimes faster as noted by others in this thread.

2 - In some instances, the use of negative numbers results in undefined or
implementation specific behavior and I prefer to dodge this issue by using
unsigned e.g. possibly_some_negative_number >>
possibly_some_other_negative_number.

3 - Array bounds checking is simpler e.g. if (index > array_upper_bound)
index_is_out_of_array_bounds.

4 - You don't have to worry as much about one's complement versus two's
complement issues.

5 - I'm sure there is some other reason I can't think of right now.


>
>I decided to define bitboard as unsigned but except it my varaibles are usually
>not unsigned including the hash key for the position.
>
>My question is if there is an advantage for using unsigned varaibles.




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.