[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] initialisation of random number generator on 64bit machine
From: |
Brian Gough |
Subject: |
Re: [Bug-gsl] initialisation of random number generator on 64bit machine |
Date: |
Mon, 15 Sep 2008 15:57:30 +0100 |
User-agent: |
Wanderlust/2.14.0 (Africa) Emacs/22.2 Mule/5.0 (SAKAKI) |
At Fri, 12 Sep 2008 16:52:48 +0200,
Vito Trianni wrote:
> Please find attached an example program that reproduces the error I
> was experiencing. I tested it on both 32- and 64-bit architectures,
> and it actually does not produce random values on the latter (see the
> "local" values in the last line of output: it varies across different
> runs on 32-bit architectures, but it does not on 64-bit ones).
Thanks for the example program.
What is happening here is that your seeding expression
floor(value*((1.0 + max - min)+min)) always returns values which are
multiples of 2^32, due to the limited range of double values being
returned. These are mapped to the same seed (zero) modulo 2^32.
I have added a note to the manual that the generators only accept
32-bit seeds.
--
Brian Gough
GNU Scientific Library -
http://www.gnu.org/software/gsl/