vendredi 13 juillet 2018

I do not why but in Linux and macOS this code generate differents pseudo-random number, but in Windows (whit MinGW) it generate always the same(272).

Thank you for your help.

Here there is the code.

#include <iostream>
#include <random>

int main()
{   

int casuale = 0;
const int n = 300;

std::random_device rd;
std::mt19937 gen(rd());
std::binomial_distribution<> d(n, 0.9);

casuale = d(gen);

std::cout << casuale << std::endl;

}




Aucun commentaire:

Enregistrer un commentaire