📄 random.h
字号:
#ifndef _RANDOM_H
#define _RANDOM_H
#include <stdlib.h>
#include <math.h>
class Random {
public:
Random();
double nextDouble();
double nextDouble(double max);
double nextDouble(double min, double max);
int nextInt(int max);
double nextGaussian();
double nextGaussian(double,double);
int flip(double prob);
void setSeed(int);
void setSeed(long);
private:
long idum; // this is the seed
long IA;
long IM;
double AM;
long IQ;
long IR;
long NTAB;
double NDIV;
double EPS;
double RNMX;
long iy;
long *iv;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -