-
Notifications
You must be signed in to change notification settings - Fork 945
Closed
Description
The alternate RNG proposed in the book (using C++11's std::mt19937
) is wrong. It's listed as
inline double random_double(double min, double max) {
static std::uniform_real_distribution<double> distribution(0.0, 1.0);
static std::mt19937 generator;
return generator(distribution);
}
but the last line as the items reversed. It should be
inline double random_double(double min, double max) {
static std::uniform_real_distribution<double> distribution(0.0, 1.0);
static std::mt19937 generator;
return distribution(generator);
}