Function Aux::Random::probability

Function Documentation

double Aux::Random::probability()

Note

this differs from real() in returning a value in a closed instead of a half-open range.

Warning

Compared to obtaining a reference to a generator using getURNG() and then using a local std::uniform_int_distribution, this method incurs a slow-down of up to 30%. Consider avoiding it in hot sections.

Returns:

a double distributed uniformly in the range [0, 1]