Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: [ot] when using >>, filling with 0 or 1

Author: Dann Corbit

Date: 12:29:03 10/05/02

Go up one level in this thread


On October 05, 2002 at 14:38:12, Antonio Dieguez wrote:

>hi, dumb question. In a book i saw when using the >> operator, with signed
>numbers, it is dependant on the machine if it is filled the left with 0 or 1. I
>supossed it were always 0. May be in practice it is always 0 in pcs, is that the
>case? should i be worried about?

If you are using (for instance) 64 bit bitboards, you should definitely make
them unsigned.

If the sign bit is set, then shifts will differ from machine to machine, and
could even differ from compiler to compiler.

Shifting negative numbers is generally not a good idea unless you have no other
choice and then you must be careful.



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.