Now... (Random Numbers) [message #29880] |
Mon, 25 March 2002 10:41 |
Andrew Loughe
Messages: 9 Registered: October 1998
|
Junior Member |
|
|
G Karas wrote:
>
> I was trying to make some unique filenames...
>
> first I tried the randomn() function, but it always gave
> back the same number for the same seed...
I use something like this to generate a random number...
seed = LONG( (SYSTIME(1) - LONG(SYSTIME(1))) * 1.e6 )
randnum = RANDOMU(seed, 1)
print, randnum, format='(f27.25)'
For your purpose, the value of "seed" might be used in the filename.
--
Andrew Loughe =====================================================
NOAA/OAR/FSL/AD R/FS5 | email: Andrew.Loughe@noaa.gov
325 Broadway | wwweb: www-ad.fsl.noaa.gov/users/loughe
Boulder, CO 80305-3328 | phone: 303-497-6211 fax: 303-497-6301
|
|
|