I just start learn how to use root, and there have some problem about the Scientific notation in output, such like this
however when i read the ROOTPrimer, i find the output in ROOTPrimer is using the Scientific notation.
so i want to know how to make my output the same as ROOTPrimer’s.
Hi,
I think we simply changed the output format since the ROOT version that was used too generate the graphics in the primer. Maybe we should update that screenshot…
Cheers, Axel
1 Like
I have updated the primer. Thanks to have seen it.
To get the full precision do:
cout << TMath::Abs(geom_series - (1-TMath::Power(x,N-1))/(1-x)) <<endl;
That’s what is suggested in the primer now.
1 Like
oh, it’s right, thank you very much.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.