Home »
Public Forums »
archive »
Re: random number trap
Re: random number trap [message #4971] |
Mon, 04 September 1995 00:00  |
sterner
Messages: 106 Registered: February 1991
|
Senior Member |
|
|
In article <DE33pI.G1D@hpl.hp.com>, peter@hpl.hp.com (Peter Webb) writes:
> So if you repeatedly call a procedure that
> calls randomu, the return will be the same if the calls occur within a
> second of each other, but will be different if they are in different
> seconds.
>
Maybe this has been answered already since I haven't been following
this newsgroup for a few days.
The way I solve this is to include a common unique to the routine
needing random numbers and store the random number seed in that
common. This is only needed if the routine is called multiple
times with more than one call per second. If you generate all the
needed random numbers in the same call this problem does not occur
(as you stated above).
Ray Sterner sterner@tesla.jhuapl.edu
The Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
WWW Home page: ftp://fermi.jhuapl.edu/www/s1r/people/res/res.html
|
|
|
Current Time: Sat Oct 11 15:44:19 PDT 2025
Total time taken to generate the page: 1.36112 seconds