40 #if (RAND_MAX==0x7fff) // 15 bits? This is really too small!! 41 int a = std::rand()<<15;
43 return double(a|b)/((RAND_MAX<<15)|RAND_MAX);
45 return double(std::rand())/RAND_MAX;
96 double pi=3.1415926535897932384626433832795;
98 return double(std::sqrt(-2*std::log(x))*std::cos(2*pi*
doubleRandom()));
void initRandom(unsigned int s)
Init with seed.
Definition: Random.h:18
size_t size_tRandom(size_t a)
Uniform size_t.
Definition: Random.h:77
double doubleRandom()
Uniform double.
Definition: Random.h:38
double gaussianRandom()
Normal law.
Definition: Random.h:87
Imagine++ namespace.
Definition: Array.h:7
int intRandom(int a, int b)
Uniform int.
Definition: Random.h:55
unsigned int uintRandom(unsigned int a)
Uniform unsigned int.
Definition: Random.h:66