Initializes a 48-bit random number generator.
#include <stdlib.h> unsigned short *seed48 (unsigned short seed_16v[3]);
The function works by generating a sequence of 48-bit integer values, Xi, according to the linear congruential formula:
Xn+1 = (aXn+c)mod m n > 0
The argument m equals 248 , so 48-bit integer arithmetic is performed. Unless you invoke the lcong48 function, the multiplier value a and the addend value c are:
a = 5DEECE66D16 = 2736731631558 c = B16 = 138
The initializer function seed48:
The returned pointer allows you to restart the pseudorandom sequence at a given point. Use the pointer to copy the previous Xi value into a temporary array. To resume where the original sequence left off, you can call seed48 with a pointer to this array.
See also drand48, lrand48, and mrand48 in this section.
x | A pointer to a 48-bit internal buffer. |