Skip to content

Instantly share code, notes, and snippets.

@TheBuzzSaw
Created August 21, 2017 22:35
Show Gist options
  • Select an option

  • Save TheBuzzSaw/2bc1e4715ce6a1159d9407f6adc21f40 to your computer and use it in GitHub Desktop.

Select an option

Save TheBuzzSaw/2bc1e4715ce6a1159d9407f6adc21f40 to your computer and use it in GitHub Desktop.
Normal distributions
#include <iostream>
#include <random>
#include <ctime>
using namespace std;
int main(int argc, char** argv)
{
mt19937 mt(time(nullptr));
normal_distribution<double> distribution(0.0, 4.0);
for (int i = 0; i < 16; ++i)
{
cout << distribution(mt) << '\n';
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment