Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/7/84; site ucbvax.ARPA Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!info-vax From: info-vax@ucbvax.ARPA Newsgroups: fa.info-vax Subject: mth Message-ID: <3016@ucbvax.ARPA> Date: Fri, 2-Nov-84 09:42:13 EST Article-I.D.: ucbvax.3016 Posted: Fri Nov 2 09:42:13 1984 Date-Received: Sat, 3-Nov-84 07:05:56 EST Sender: daemon@ucbvax.ARPA Organization: University of California at Berkeley Lines: 33 From: callas%meteor.DEC@decwrl.ARPA (Hardware is just a mathematical abstraction) Mth$random is documented in the Run-Time Library Reference Manual, which is volume 6A of a full VMS V3 documentation set. Documentation can also be found by typing "HELP RTL MTH$ RANDOM" under V3.x or "HELP RTL MTH$ MTH$RANDOM" under V4. The calling sequence has not changed from V3 to V4. Here is a copy of the help library text from V3.7: RTL MTH$ RANDOM Random Number Generator, Uniformly Distributed Format result.wf.v = MTH$RANDOM (seed.mlu.r) Arguments seed An unsigned longword containing the integer seed. result The F_floating random number. A call to MTH$RANDOM will return a number in the interval [0.0,1.0). My favorite way to initialize the seed is to call SYS$GETTIM to get the quadword system time and use the middle longword (16 bits filler, 32 bits seed number, 16 bits filler) as the seed. If you are calling mth$random many times, resetting the seed from the clock every so often (say every 100 to 10,000 calls) can make mth$random a truly random variable.