I am looking to create large non-negative integer random values in a POSIX system. I found two possible functions that correspond to the account, and their respective initializers:
#include <stdlib.h>
long int random(void);
void srandom(unsigned int seed);
CONFORMING TO
4.3BSD, POSIX.1-2001.
long int lrand48(void);
void srand48(long int seedval);
CONFORMING TO
SVr4, POSIX.1-2001.
- What features are preferred (thread safety and range of generated values)?
- Given that safety is not a concern, how should I plant them?
- If sowing methods differ from each other due to different arguments for the sowing functions (
long intvs. unsigned int)?
source
share