[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fun with random numbers
- Subject: Re: fun with random numbers
- From: morisset(at)my-deja.com
- Date: Thu, 02 Mar 2000 12:46:36 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: Deja.com - Before you buy.
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:18741
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.