LCONG48 - set parameters for random number generation.

(Compatible with UNIX System V C)

Usage:

void lcong48();
lcong48(parmvec);

Where:

unsigned short parmvec[7];
contains parameter values for the 48 bit pseudo-random number generation routines.

Description:

"lcong48" sets parameters for the pseudo-random number generation routines. The generation algorithm used by the routines is

X1 = (A*X0 + C) % (2**48)

where C is a 16 bit integer and X1, X0, and A are all 48 bit integers. X1 is the new random number. X0 is the previous random number (or the seed on the first call to a random number function). A is called the multiplier and C is called the addend.

By default, A is 0x5DEECE66D and C is 0xB. "lcong48" lets you specify new values for these. The array elements "parmvec[0-2]" give a 48 bit random seed (taking the low order 16 bits of each array element). "parmvec[3-5]" give a new value for A, again using the low order 16 bits of each element. "parmvec[6]" gives a new value for C (using the low order 16 bits).

Notes:

The functions "srand48" and "seed48" set A and C back to their default values.

See Also:

expl c lib seed48
expl c lib drand48
expl c lib erand48
expl c lib jrand48
expl c lib srand48
expl c lib mrand48
expl c lib nrand48
expl c lib rand

Copyright © 1996, Thinkage Ltd.