lcong48

Initializes a 48-bit uniformly distributed pseudorandom number sequences.

Format

#include  <stdlib.h>

void lcong48  (unsigned short int param[7]);

Arguments

param
An array that in turn specifies the initial Xi, the multiplier value a, and the addend value c.

Description

This function generates pseudorandom numbers using the linear congruential algorithm and 48-bit integer arithmetic.

You can use lcong48 to initialize the random number generator before you call any of the following functions:


drand48
lrand48
mrand48

The lcong48 function specifies the initial Xi value, the multiplier value a, and the addend value c. The param array elements specify the following:
param[0-2]  Xi 
param[3-5]  Multiplier a value 
param[6]  16- bit addend c value 

After lcong48 has been called, a subsequent call to either srand48 or seed48 restores the standard a and c as specified previously.

The lcong48 function does not return a value.

See also drand48, lrand48, mrand48, srand48, and seed48 in this section.


Previous Page | Next Page | Table of Contents | Index