I expect to receive different outputs, but I am getting two zeros independent of the seed value (here used 1
nad 2
):
#include <iostream>
#include <string>
#include <random>
using namespace std;
int main()
{
default_random_engine e1(1);
default_random_engine e2(2);
uniform_int_distribution<int> chose(0, 50);
int a1 = chose(e1); cout << a1 << endl;
int a2 = chose(e2); cout << a2 << endl;
}
What is wrong with my code?
Update: Based on the suggestions from @arekolek I did a little experiment. For seeds <= 2903
the first number is always the smallest number of the distribution. For seeds >= 2904
is smallest number +1
. Increasing the seed this pattern remains.