Using ULong64_t on a 32-bit machine


Is there a problem to use the integer type Ulong64_t (or Long64_t) on a 32-bits machine?

I test the following macro and I got a wrong answer when the number is larger than 32 bits. Your suggestions are most appreciated. Tim

ULong64_t test64;
cout << test64<< endl;
cout << test64<< endl;

4000000000ULL = 4000000000
5000000000ULL = 705032704

When reporting a problem, please ALWAYS indicate which version and OS you ar using. Your tests work correctly with the current ROOT versions.


Hi, continuing on the previous e-mail.

I found the workaround provided by Masa Goto. This work around works on a Linux machine running Red Hat Linux Enterprise 4: e.g.,

ULong64_t test= 10000000000ULL*10; //This works


ULong64_t=(ULong64_t) 1010001000*10; // this also works

However, this workaround does not seem to work on the precompiled Windows binary version (Win32GDK, compile with VC++ 7.1) running on Windows XP.

Is there a similar workaround for the Windows version?
or do I need to compile the code on a 64 bit machine?


this is indeed a bug on windows. We will try to correct this.


Thank you for reporting this problem. It turns out that it was only a printing/output problem. The variable already had internally the correct value. For example see the result of:

root [0] ULong64_t test= 10000000000ULL*10; //This works root [1] Form("%llu",test)
Anyway this problem is now fixed in the CINT cvs repository and will be upload into the ROOT cvs repository later this week.