- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page