Re: long long behaves unexpectedly...

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Tue, 01 Mar 2005 18:25:34 +0100


Hi Kazuya,

  this has been fixed in the latest version of CINT which we hope to introduce in the coming days.

Cheers, Fons.

Kazuya AOKI wrote:
> Dear ROOT exprets,
>
> I have trouble with long long.
> I tried to execute the following script
>
> ///// source --------------------------------------
>
> void test(void){
> for(int i=0; i<10; i++){
> long long data;
> data=43000LL; // <----- !!!! here !!!!
> cout << i << " : " << data << endl;
> }
>
> return;
> }
> -------------------------------------------------------
>
> the results are the following
>
> ///// result -----------------------------------------------
>
> root [0] .x test.C
> 0 : 43000
> 1 : 167797363
> 2 : 167797363
> 3 : 167797363
> 4 : 167797363
> 5 : 167797363
> 6 : 167797363
> 7 : 167797363
> 8 : 167797363
> 9 : 167797363
> root [1]
>
> -------------------------------------------------------------
>
> but what i expect is, of course, the following.
>
> ///// ( expected )result -----------------------------------------------
>
> root [0] .x test.C
> 0 : 43000
> 1 : 43000
> 2 : 43000
> 3 : 43000
> 4 : 43000
> 5 : 43000
> 6 : 43000
> 7 : 43000
> 8 : 43000
> 9 : 43000
> root [1]
> ---------------------------------------------------------------------
>
> when I compiled the source with g++ ,
> I got the expected results.
>
> Could you give me some advice?
>
> the following is the ROOT version i use.
>
> ////// version
>
> [fukao_at_rcas2077 ~]$ root
> *******************************************
> * *
> * W E L C O M E to R O O T *
> * *
> * Version 4.01/02 1 December 2004 *
> * *
> * You are welcome to visit our Web site *
> * http://root.cern.ch *
> * *
> *******************************************
>
> FreeType Engine v2.1.3 used to render TrueType fonts.
> Compiled for linux with thread support.
>
> CINT/ROOT C/C++ Interpreter version 5.15.152, Sep 13 2004
> Type ? for help. Commands must be C++ statements.
> Enclose multiple statements between { }.
> root [0]
>
> Best Regards,
> Kazuya

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://www.rademakers.org/fons/      Fax:   +41 22 7679480
Received on Tue Mar 01 2005 - 18:27:04 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET