Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uwm.edu!rpi!dali.cs.montana.edu!ogicse!milton!uw-beaver!ubc-cs!sol.UVic.CA!klassen From: klassen@sol.UVic.CA (Melvin Klassen) Newsgroups: comp.lang.fortran Subject: Re: randu? Summary: A history lesson Message-ID: <1991Mar1.010946.16149@sol.UVic.CA> Date: 1 Mar 91 01:09:46 GMT References: <62349@eerie.acsu.Buffalo.EDU> Organization: University of Victoria, Victoria B.C. CANADA Lines: 18 haozhou@acsu.buffalo.edu (Hao Zhou) writes: >I am trying to port some fortran source code from vax/vms to sun/unix. >The source code compiles on unix but doesn't link since randu couldn't >be found. I checked the code and found randu is referred as follows: > > call randu(i1,i2,u) > >where i1,i2,and u weren't initialized before the call. I guess this >routine returns a random number in u and i1 and i2 are two seeds. > RANDU originated in the IBM SSP (Scientific Subroutine Package) in the early 1970's. It has three arguments: - IX, which is the "seed" for the (pseudo-) random-number generator, (set IX to some positive, odd, number before the very-first CALL), - IY, which is returned as the value which the caller should store into IX before calling RANDU again, - Z, which is returned as a floating-point number *uniformly* (hence the U-suffix) distributed in the 0.0 to 1.0 range.