GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ranf.f
Go to the documentation of this file.
1  REAL FUNCTION ranf()
2 C**********************************************************************
3 C
4 C REAL FUNCTION RANF()
5 C RANDom number generator as a Function
6 C
7 C Returns a random floating point number from a uniform distribution
8 C over 0 - 1 (endpoints of this interval are not returned) using the
9 C current generator
10 C
11 C This is a transcription from Pascal to Fortran of routine
12 C Uniform_01 from the paper
13 C
14 C L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package
15 C with Splitting Facilities." ACM Transactions on Mathematical
16 C Software, 17:98-111 (1991)
17 C
18 C**********************************************************************
19 C .. External Functions ..
20  INTEGER ignlgi
21  EXTERNAL ignlgi
22 C ..
23 C .. Executable Statements ..
24 C
25 C 4.656613057E-10 is 1/M1 M1 is set in a data statement in IGNLGI
26 C and is currently 2147483563. If M1 changes, change this also.
27 C
28  ranf = ignlgi()*4.656613057e-10
29  RETURN
30 
31  END