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

Home » Public Forums » archive » Re: fun with random numbers
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: fun with random numbers [message #19236 is a reply to message #19229] Thu, 02 March 2000 00:00 Go to previous messageGo to previous message
morisset is currently offline  morisset
Messages: 17
Registered: October 1997
Junior Member
Hi,
The bug comes from the unidentification of seed in
the first randomu call of every call of test.pro
The solution is to save the value of seed between
different calls of test.pro
Or you might use common block (Ok, David, I know...) or
a system variable:

PRO test
common seed_for_test,seed

x= RANDOMU(seed,1)
y= RANDOMU(seed,4)
PRINT,'x',x
PRINT,'y',y

RETURN

END

or

PRO test
defsysv,'!seed',EXISTS = seed_exists
if seed_exists then seed = !seed

x= RANDOMU(seed,1)
y= RANDOMU(seed,4)

defsysv,'!seed',seed

PRINT,'x',x
PRINT,'y',y

RETURN

END







Sent via Deja.com http://www.deja.com/
Before you buy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Adding .sav files to menu in ENVI
Next Topic: Re: Radon Transform

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

Current Time: Sat Oct 11 21:13:51 PDT 2025

Total time taken to generate the page: 0.63998 seconds