srand48()

Initialize a sequence of pseudo-random numbers

Synopsis:

#include <stdlib.h>

void srand48( long seed );

Arguments:

seed
The seed of the sequence of pseudo-random integers.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The srand48() is used to initialize the internal buffer r(n) of drand48(), lrand48(), and mrand48() such that the 32 bits of the seed value are copied into the upper 32 bits of r(n), with the lower 16 bits of r(n) arbitrarily being set to 0x330E. Additionally, the constant multiplicand and addend of the algorithm are reset to the default values: the multiplicand a = 0xFDEECE66D = 25214903917 and the addend c = 0xB = 11.

Classification:

POSIX 1003.1 XSI

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Last modified: 2013-12-23

comments powered by Disqus