[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RANDOMU bug (and HTML help)
Andy Schmitt (ajschmitt@my-dejanews.com) writes:
> This is not the worst of it. For some of us, it is important to be able
> to have the same seed so that the same "random" sequence is produced.
> However, RSI quietly changed the manner in which the SEED variable
> interacts with the RANDOM functions between version 5.0 & 5.1.
>
> Consider the following behavior from IDL v 5..0.3:
> IDL> seed = 2 & print, randomu(seed, 3)
> 0.342299 0.402381 0.307838
> ...doing this multiple times will always give the same result.
>
> However, in IDL v.5..1 & later,. using this several times in a row
> produces different results each time.:
> IDL> seed = 2 & print, randomu(seed, 3)
> 0.0594004 0.982075 0.358593
> IDL> seed = 2 & print, randomu(seed, 3)
> 0.831999 0.303037 0.506712
>
> ...etcetera. It turns out that you now have to specify a NEGATIVE seed
> in order for it to have any influence on the generated sequence:
>
> seed = -2 & print, randomu(seed, 3)
> 0.342299 0.402381 0.307838
> seed = -2 & print, randomu(seed, 3)
> 0.342299 0.402381 0.307838
For what it is worth, this line produces the very same
result over and over again in my Windows NT IDL 5.2a version:
IDL> seed = 2 & print, randomu(seed, 3)
0.342299 0.402381 0.307838
IDL> seed = 2 & print, randomu(seed, 3)
0.342299 0.402381 0.307838
IDL> seed = 2 & print, randomu(seed, 3)
0.342299 0.402381 0.307838
IDL> seed = 2 & print, randomu(seed, 3)
0.342299 0.402381 0.307838
Perhaps it is fixed in IDL 5.2? When you say "IDL v5.1 & later"
did you test it in IDL 5.2? I've been having my own problems
with unannounced changes in the way !D.N_Colors works from
IDL 5.0 to 5.1 to 5.2. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155