Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Can someone explain this line to me?

Author: Daniel Karlsson

Date: 15:23:06 06/30/99

Go up one level in this thread


On June 30, 1999 at 12:28:05, TEERAPONG TOVIRAT wrote:

>    h=hashtable+(h_key.address&(TAB_SIZE/2)-1));

>TAB_SIZE = unsigned long = 262144
>
>I'm not sure what does "&" mean in this situation?

Binary 'and'. In this case (TAB_SIZE is a power of 2) it's equivalent to modulo,
only faster.

Compare with
h = &hashtable[h_key.address % (TAB_SIZE / 2)];



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.