[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RANDOMU bug (and HTML help)




Bill Thompson wrote:

> Naively, I expected that
> if one deleted the seed variable, that would force IDL to re-initialize the
> seed, based on the system time or whatever.  However, if my next command is
> 
> IDL> delvar,seed & print,randomu(seed,3)
> 
> I don't get any random numbers at all.  To start getting random 
> numbers again,
> I have to use a completely new variable name for the seed, e.g.
> 
> IDL> print,randomu(seed2,3)
>      0.671149     0.383416     0.631635
> 
> I don't know if this is properly speaking a bug or not, but it's certainly
> weird.  As far as I can tell, this behavior is seen in all versions of IDL.

At first, I didn't understand what you were saying here - what could you
mean by "I don't get any random numbers at all"? Was it the same number
over and over again, or what? (In retrospect, I see that this is an
incorrect interpretation of the sentence..)  Then I tried it myself:

IDL> delvar,seed & print,randomu(seed,3)

- and *no* output (hence "no random numbers at all")!

Seems like the guy who wrote the DELVAR command did something quite
bizarre:

IDL> delvar,seed & print,"HI"

- *still* no output!

Luckily, DELVAR cannot be used in programs!

Regards,

Stein Vidar