* Ranf* is a 48 bit multiplicative congruential method RNG which
produces 64 bit floating point numbers in the open interval (0,1).
More precisely, it produces a sequence of uniform variates
based on the following formulas:

(43.1) | |||

(43.2) |

where the (integer) multiplier = 0x2875a2e7b175
^{43.1}and the (integer) default seed = 0x948253fc9cd1.
Note that the minimum value for is
and the maximum value is .
^{43.2}

On the Cray, *ranf* is loaded from the *Mathlib*
library. The workstation version is based on the * drand48* suite of library functions. Although these two
libraries implement the same basic arithmetic, there is a subtle
difference in that *drand48* computes the next seed and
returns that value divided by ,
whereas *ranf* saves the old seed, computes the next,
and then returns the old seed divided by .
The result is that the sequence from *drand48* is "one
ahead" of that from *ranf*. This problem may be solved
by decrementing or incrementing the seed by one as part of
setting or retrieving it, respectively, and this logic is built
into the workstation versions of *setranf* and *getranf*
routines below. Thus sequences generated by theBasis* ranf* are identical on Cray or workstation, and seed values
may be carried between the two architectures without a break in
the sequence.

The examples below are written as they would appear in source to
be preprocessed by *Mppl*. In Fortran terms, *ranf*
will return *double precision *on a 32 bit workstation,
and *real* on a 64 bit architecture.

- ... 0x2875a2e7b175
^{43.1} - The multiplier's inverse is = 0x5ceeb894d6dd, with .
- ....
^{43.2} - If stored in an IEEE 754 Standard single precision (32 bit) floating point format, the minimum is distinct from 0; however, the maximum (and many other values near it) are not distinct from 1.

- 43.18.1 Ranf
- 43.18.2 Getranf
- 43.18.3 Setranf
- 43.18.4 Seedranf
- 43.18.5 Mixranf