Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboards Explained?

Author: Peter Fendrich

Date: 00:34:49 04/19/99

Go up one level in this thread


On April 18, 1999 at 16:40:06, Bruce Moreland wrote:

>
>On April 18, 1999 at 13:20:23, Peter Fendrich wrote:
>
>>I recommend you to use unsigned because otherwise one never knows what compilers
>>will try to do... :)
>
>You can figure out that a signed value is a bad idea without having to guess
>about compiler implementations.
>
>If you ever try to shift a signed value to the right, and the top bit is set,
>the top bit will stay set, and any bits to the left of the new location of what
>once was the top bit will also be set.
>
>This is something you obviously don't want if you are ever going to shift one of
>these things to the right.
>
>bruce

Yes, that's obviously true and these things will surely be shifted right...
Without being the real expert here, I think it's a good idea anyway to use
unsigned int's whenever it's possible. Especially if they are going to be sent
between functions, used by runtime lib's or compiled with different compilers.
Over time hardware is changing and that could be another reason to use unsigned,
I think.
//Peter





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.