Linux C函数库参考手册之随机数函数

drand48(产生一个正的浮点型随机数)

#include <stdlib.h>
double drand48(void);

erand48(产生一个正的浮点型随机数)

#include <stdlib.h>
double erand48(unsigned short xsubi[3]);

initstate(建立随机数状态数组)

#include <stdlib.h>
char *initstate(unsigned int seed, char *state, size_t n);

jrand48(产生一个长整型数随机数)

#include <stdlib.h>
long int jrand48(unsigned short xsubi[3]);

lcong48(设置48位运算的随机数种子)

#include <stdlib.h>
void lcong48(unsigned short param[7]);

lrand48(产生一个正的长整型随机数)

#include <stdlib.h>
long int lrand48(void);

mrand48(产生一个长整型随机数)

#include <stdlib.h>
long int mrand48(void);

nrand48(产生一个正的长整型随机数)

#include <stdlib.h>
long int nrand48(unsigned short xsubi[3]);

rand(产生随机数)

#include <stdlib.h>
int rand(void);

random(产生随机数)

#include <stdlib.h>
long int random(void);

seed48(设置48位运算的随机数种子)

#include <stdlib.h>
unsigned short *seed48(unsigned short seed16v[3]);

setstate(建立随机数状态数组)

#include <stdlib.h>
char *setstate(char *state);

srand(设置随机数种子)

#include <stdlib.h>
void srand(unsigned int seed);

srand48(设置48位运算的随机数种子)

#include <stdlib.h>
void srand48(long int seedval);

srandom(设置随机数种子)

#include <stdlib.h>
void srandom(unsigned int seed);

Leave a Reply

Your email address will not be published. Required fields are marked *