Initialize the seed for a sequence of pseudo-random numbers
#include <stdlib.h>
unsigned short int *seed48(
unsigned short int seed16v[3] );
libc
The seed48() initializes the internal buffer r(n) of drand48(), lrand48(), and mrand48(). All 48 bits of the seed can be specified in an array of 3 shorts, where the entry with index 0 specifies the lowest bits. The constant multiplicand and addend of the algorithm are reset to the defaults: the multiplicand a = 0xFDEECE66D = 25214903917 and the addend c = 0xB = 11.
A pointer to an array of 3 shorts which contains the old seed. This array is statically allocated, thus its contents are lost after each new call to seed48().
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
drand48(), erand48(), jrand48(), lcong48(), lrand48(), mrand48(), nrand48(), srand48()