ROOT Version: 6.14.04
Platform: Ubuntu 18.04
Compiler: gcc 7.3
Dear experts
I have a puzzle about the result of calling subroutine and do in main function when generating random numbers. Here is the macro:
void printrand()
{
TRandom3 r;
std::cout << r.Uniform(0, 1) << std::endl;
}
void myrand()
{
TRandom3 r1;
for(int i=0; i<5; i++) std::cout << r1.Uniform(0, 1) << std::endl;
for(int i=0; i<5; ++i) printrand();
}
Below is the output:
0.999742
0.16291
0.282618
0.947201
0.231657
0.999742
0.999742
0.999742
0.999742
0.999742
Why the result from calling subroutine turning out the same?
Many thanks in advance.
Yousen