> Same random sequence generation (Gergely Czuczy)

Jim White mathimagics at yahoo.co.uk
Sat Apr 1 15:13:18 CEST 2006

> QueryPerformanceCounter(&l);
> seed = rand();
> seed ^= l.LowPart;

QueryPerformanceCounter should be ok, on most PC's
it's driven by a 3579545hz (3.58MHz) clock (this is
some NTSC-related standard all 32-bit PC's seem to
have in common).  I use it as a real-time clock for
performance evaluation.

One easy way to create the impression of getting the
same value is to pick up the wrong 32-bit half of the
result, but from the MSDN definition of LARGE_INTEGER
it looks like that isn't your problem.  

I suggest you display the actual values of both
l.Lowpart and l.HighPart that you're getting and see
what they look like.

Jim White

More information about the gmp-discuss mailing list