home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4205 < prev    next >
Encoding:
Text File  |  1992-11-04  |  1.4 KB  |  32 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!nih-csl.dcrt.nih.gov!helix.nih.gov!rvenable
  3. From: rvenable@helix.nih.gov (Richard M. Venable)
  4. Subject: Re: function for generating the random numbers
  5. Message-ID: <1992Nov5.062904.17315@alw.nih.gov>
  6. Sender: postman@alw.nih.gov (AMDS Postmaster)
  7. Organization: National Institutes of Health, Bethesda
  8. References: <1992Nov3.215800.11143@leland.Stanford.EDU>
  9. Distribution: usa
  10. Date: Thu, 5 Nov 1992 06:29:04 GMT
  11. Lines: 19
  12.  
  13. In article <1992Nov3.215800.11143@leland.Stanford.EDU> sangwook@leland.Stanford.EDU (Sang Wook Sihn) writes:
  14. >Hi,
  15. >Does anyone know how to generate the random numbers with fortran?
  16. >Thanx.
  17.  
  18. First, I'd recommend consulting the book "Numerical Recipes" and read the
  19. sections (and code) on random number generation.  It should be found in any
  20. good technical library.
  21.  
  22. Random numbers are selected from some underlying distribution, such as a
  23. uniform (all equally probable) or Gaussian (the 'normal' distribution).  Most
  24. systems, including those with Unix, provide some type of call to provide
  25. a 'random' integer or real number from a uniform distribution.  The Unix 'rand'
  26. function can be called from Fortran, as well as C, for example.
  27.  
  28. If you intend to use the random numbers for any serious scientific work, you
  29. should test the random number generator very carefully before using it.  Not
  30. all vendor-supplied random number routines are scientifically rigorous.
  31.  
  32.