Different random numbers, Normal Distribution


Please read tips for efficient and successful posting and posting code

_ROOT Version:6.20/02
Platform:
Compiler: gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)


Hello everyone,

I want to get a random number from a normal distribution with a specific mean and sigma.
I do that:

TRandom myRandom(12345);

float x=myRandom.Gaus(22.137,4.7050);
cout << x<<endl;

I run it many times and I always get the same random number, but I want to get different random number every time I run it (with the same mean and sigma).
How Can I do that?

Thank you

TRandom3 myRandom(0);

Yeah, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.