URAND: A Universal Random Number Generator
STANFORD UNIV CA DEPT OF COMPUTER SCIENCE
Pagination or Media Count:
A subroutine for generating uniformly-distributed floating-point numbers in the interval 0,1 is presented in ANSI standard Fortran. The subroutine, URAND, is designed to be relatively machine independent. URAND has undergone minimal testing on various machines and is thought to work properly on any machine having binary integer number representation, integer multiplication modulo m and integer addition either modulo m or yielding at least log of m to the base 2 significant bits, where m is some integral power of 2. Upon the first call of URAND, the value of m is automatically determined and appropriate constants for a linear congruential generator are computed following the suggestions of D. E. Knuth, Volume 2. URAND is guaranteed to have a full-length cycle.
- Computer Programming and Software