PreviousIndexNext

[bug-gsl] Re: initialisation of random number generator on 64bit machine (2008-09-12)

From: Vito Trianni <vtrianni@.........>
Subject: Re: initialisation of random number generator on 64bit machine
Date: Fri, 12 Sep 2008 16:52:48 +0200
To: bug-gsl@gnu.org

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).
Let me know if I can help more.
Regards,
Vito


Attachment: bug-gsl.cpp
Description: Binary data







On Sep 5, 2008, at 6:22 PM, Brian Gough wrote:

At Wed, 03 Sep 2008 15:43:33 +0200,
Vito Trianni wrote:

Hello,
I noticed the following behaviour when initialising the random number
generator on a 64bit machine. Basically, on a 64 bit machine, the
unsigned long int probably provokes an overflow in the gsl_rng_set()
function, so that the initialisation of the seed in some way fails, and
I got always identical numbers despite different seeds. Here is part of
the code that made the overflow:

Thanks for your email -- could you send a complete example program
showing the seed and output values so we can reproduce the
problem. Thank you.

--
Brian Gough

GNU Scientific Library -
http://www.gnu.org/software/gsl/

= = ========================================================================
Vito Trianni, Ph.D. vito.trianni@(no_spam)istc.cnr.it
CNR-ISTC http://laral.istc.cnr.it/trianni
via San Martino della Battaglia, 44
00185 Roma Tel: +39 06 44595 215
Italy Fax: +39 06 44595 243
= = ========================================================================