#include <math.h>
Defines | |
| #define | MPLIER 16807 |
| #define | MODLUS 2147483647 |
| #define | MOBYMP 127773 |
| #define | MOMDMP 2836 |
Functions | |
| int | PMrand (int *state) |
| This function returns a pseudo-random number for each invocation. More... | |
|
|
This function returns a pseudo-random number for each invocation. This C implementation, is adapted from a FORTRAN 77 adaptation of the "Integer Version 2" minimal standard number generator whose Pascal code described by \cite [ParMil88 unknown reference! ]. This code is portable to any machine that has a maximum integer greater than, or equal to, 2**31-1. Thus, this code should run on any 32-bit machine. The code meets all of the requirements of the "minimal standard" as described by \cite [ParMil88 unknown reference! ]. Park and Miller note that the execution times for running the portable code were 2 to 50 times slower than the random number generator supplied by the vendor. |