Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: a stupid doubt with the ^

Author: Bruce Moreland

Date: 19:33:41 05/16/00

Go up one level in this thread


On May 16, 2000 at 22:14:49, Antonio Dieguez wrote:

>hello, at last im really implementing hash tables, and they are already working
>on my program, more or less.
>
>I have a doubt about the ^, am sorry my complete ignorance but what kind of
>numbers appears? for example two numbers of 7 digits sometimes results on a
>number of 8 digits! and off course this cant be out of control if it is the
>index for the hash table.
>
>Thanks in advance...
>
>bye bye............. be well.
>
>me.

^ is XOR.  If you say A ^ B, you get zeros in every bit position except where
there was a one-bit in A and a zero-bit in B, or vice versa.

1 ^ 1 = 0
1 ^ 0 = 1
0 ^ 1 = 1
0 ^ 0 = 0

There is no carrying, so if you have two numbers A and B, A ^ B can't be more
than A | B.  You can't XOR two 7-bit numbers and get a number that's 8-bits.

bruce



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.