Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
johansoderstrom
Total Points:
40
Registered User
November 13, 2008 3:13 AM PST
RANDOM_SEED() and RANDOM_NUMBER()

Hi again

I am trying to obtain a set of random numbers and I use this code:

      USE DFPORT

      REAL T1

      CALL RANDOM_SEED()

      CALL RANDOM_NUMBER(T1)

Now this does give me a random number, based on the date and time... But if I call it several times in a row (fast) it seems to me that the Random numbers do not change (I convert them into a Gaussian distribution and I typically get a set of random numbers but the same number being repeated over 20 times until it changes) - as the time is the same... is there any way of initializing RANDOM_SEED() with time and date, but with...say... microseconds instead of seconds (or what is used in the routine right now)... to get "more" randomized numbers...

I hope this makes sence... 

Thanks,

Johan S

andi_zuend
Total Points:
140
Status Points:
0
Green Belt
November 13, 2008 4:39 AM PST
Rate
 
#1
Hi,

I guess your target is to get a new random number at every call to RANDOM_NUMBER, so you only need once (or never, see the User and Reference Guides) to call RANDOM_SEED. This is just to seed the random number generator at the beginning, thus, it shouldn't be called in a loop.

best,
Andi




Intel Software Network Forums Statistics

8478 users have contributed to 31609 threads and 100661 posts to date.
In the past 24 hours, we have 30 new thread(s) 108 new posts(s), and 167 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member zhpn