Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: boundschecking

Author: Uri Blass

Date: 12:29:02 11/04/02

Go up one level in this thread


On November 04, 2002 at 15:07:12, Severi Salminen wrote:

>>>>__int64 rand64()
>>>>{
>>>>	int a,b,c,d,e;
>>>>	a=rand();
>>>>	b=rand()<<15;
>>>>	c=rand()<<30;
>>>>	d=rand()<<45;
>>>>	e=rand()<<60;
>>>>
>>>>	return a^((__int64)b)^((__int64)c)^
>>>>		((__int64)d)^((__int64)e);
>>>>}
>>>
>>>Under most systems, d and e will be zero.
>
>A few points. As Dieter said, the above is wrong, because of too late type
>casts. Secondly why do you use xor? Why not or?

I admit that I copied the function to generate random 64 bit number
from bruce's site
http://www.seanet.com/~brucemo/topics/zobrist.htm

xor was used there.


> Or has a definite sequence
>points and can be used like in your original rand64():

I used xor also in the previous function.

Uri



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.