Next / Previous / Index / TCC Help System / Publications / Site map / NM Tech homepage

Scaling random numbers in Fortran

Tech Computer Center logo

The Fortran rand() always returns a number between 0 and 1. More specifically, it is a number in the half-open interval [0,1), so you might get a 0.0 result, but the result will never be exactly 1.0 or greater.

Such a number can be scaled to produce uniformly distributed pseudorandom numbers in any interval.


Next: A sample random number Fortran program
See also: Generating random numbers in Fortran; Hints for Fortran programmers
Previous: Non-repeating pseudorandom sequences in Fortran
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Computer Center: Help System
TCC Publications
Home: About New Mexico Tech

John Shipman, john@nmt.edu

Last updated: 1995/12/19 18:58:09 UT
URL: http://www.nmt.edu/tcc/help/lang/fortran/scaling.html