Re: Random Number Replication [message #16585 is a reply to message #16584] |
Fri, 06 August 1999 00:00  |
Andy Loughe
Messages: 174 Registered: November 1995
|
Senior Member |
|
|
David Sheerin wrote:
>
> Hi
> I have tried to use the following code to generate a sequence of
> random numbers:
>
> FOR k = 1, 4 DO BEGIN
> p = RANDOMU (S)
> PRINT, p
> ENDFOR
>
> Why, when I repeat the operation, does the code (nearly) give me the
> same list of random numbers shifted by 1? I thought that each time
> RANDOMU was called it took a new value for the SEED due to S being
> undefined. How do I 'undefine' S after it has been called?
>
> Cheers
>
> David Sheerin
I am unable to replicate your results.
I always set the intial seed in this manner...
S = long( ( systime(1) - long(systime(1)) ) * 1.e8 )
p = randomu(S)
--
Andrew F. Loughe | email: afl@cdc.noaa.gov
NOAA-CIRES CDC Mail Code: R/E/CD1 | www :
http://www.cdc.noaa.gov/~afl
325 Broadway | voice: (303)497-6211
Boulder, CO 80303-3328 | fax : (303)497-7013
------------------------------------------------------------ ---------------
"I do not feel obliged to believe that the same God who has endowed us
with
sense, reason, and intellect has intended us to forego their use."
-Galileo
|
|
|