Author: Dieter Buerssner
Date: 08:11:09 11/04/02
Go up one level in this thread
On November 04, 2002 at 11:05:28, Uri Blass 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.
unsigned __int64 rand64()
{
unsigned __int64 r = rand();
r ^= (unsigned __int64)rand() << 15;
r ^= (unsigned __int64)rand() << 30;
r ^= (unsigned __int64)rand() << 45;
r ^= (unsigned __int64)rand() << 60;
return r;
}
Dieter
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.