Re: Random number generator


[ Follow Ups ] [ Post Followup ] [ K-State KDD Lab Research Discussion Forum ] [ FAQ ]

Posted by The Ostrich on March 08, 2001 at 09:19:24:

In Reply to: Re: Random number generator posted by Haipeng Guo on January 28, 2001 at 12:00:28:

Hi,

The standard code for the Mersenne Twister
algorithm seems to have some problems. One of
them is that it uses a dodgy seeding algorithm
for 32-bit seeds. The other is that its floating
point interface doesn't have double precision.
To fix the double precision problem, you can
generate 64-bit numbers, cast them to doubles
and multiply by the magic constants:

[0 1] => 5.4210108624275222e-20
[0 1) => 5.4210108624275218e-20

Note that doubles have 48-bit precision.
This should work quite nicely. For any
comments on this fix, please remove the braces
from my email address and contact me.


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ K-State KDD Lab Research Discussion Forum ] [ FAQ ]