comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » RANDOMU bug (and HTML help)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: RANDOMU bug [message #14398 is a reply to message #14330] Wed, 24 February 1999 00:00 Go to previous messageGo to previous message
Ivan Zimine is currently offline  Ivan Zimine
Messages: 40
Registered: February 1999
Member
William Thompson wrote:

> Here's another weird behavior of RANDOMU. If you call IDL with an undefined
> seed, it's supposed to initialize the seed for you. Thus, when you type in
>
> IDL> print,randomu(seed,3)
> 0.653919 0.0668422 0.722660
>
> before seed is defined to anything, it still works. 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.
>
> Bill Thompson


On my Linux box i get exactely the same thing although I don't have to
use a new
variable for the seed.

IDL> print, !version
{ x86 linux unix 5.2 Oct 30 1998}
IDL> print,randomu(seed,3)
0.272710 0.897656 0.274907
IDL> delvar,seed & print,randomu(seed,3)
no output
IDL> print,randomu(seed,3)
0.00769819 0.365339 0.266145
this works too
IDL> delvar, seed
IDL> print,randomu(seed,3)
0.986642 0.277082 0.629543


Ivan Zimine
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL Insight bug when plotting horizontal lines?
Next Topic: Re: beginners plotting question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:17:12 PDT 2025

Total time taken to generate the page: 0.00459 seconds