Skip to content

Instantly share code, notes, and snippets.

@optozorax
Last active January 12, 2019 12:54
Show Gist options
  • Save optozorax/c20c3266476801929232463d18db6b1d to your computer and use it in GitHub Desktop.
Save optozorax/c20c3266476801929232463d18db6b1d to your computer and use it in GitHub Desktop.
random by mt19937
#include <random>
double random(void) {
static std::mt19937 generator(time(0));
static std::uniform_real_distribution<double> distribution(0, 1);
return distribution(generator);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment