Dear Root users,
I try to define a Long64_t like:
Long64_t toto=4000000000; // 4e+09
cout << "toto= " << toto << endl;
but the display of this program gives me:
root [0] .X essai.cc
toto= -294967296
It looks like an overflow, doesn’t it?
I can’t understand this result, I thought a Long64_t variable could increase up to 2^63 (or 2^63 -1).
If I make something like:
Long64_t papa=0;
do
{
papa+=100000;
cout << papa << endl;
}
while (papa>=0);
then “papa” goes up more than 10^12 (I stopped the program before it ended). This proves that I can use Long64_t type well. So, why “toto” can’t be 4e9?
If anyone has a comment or a response, thanks very much.
PS: I’m working with root 4.02/00 on Mac OS 10.3.9.
Sorry, I never replied, but I just want to thank you, it works perfectly now.