Re: [ROOT] Bug in CINT?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Apr 17 2002 - 10:59:26 MEST


Hi Birger,

I am sorry, but I cannot reproduce your problem. Here is my session
as you suggest:

root [0] .L testit.C
root [1] testit()
root [2] float sum=0.
root [3] float s=0.
root [4] for(int ll=1; ll<101; ll++){s=h02->GetBinContent(ll);sum=sum+s;};
root [5] sum
(float)1.00000095367431641e+00
root [6] sum=0.
(const double)0.00000000000000000e+00
root [7] for(int ll=1; ll<101; ll++){sum+=h02->GetBinContent(ll);};
root [8] sum
(float)1.00000095367431641e+00

Rene Brun

Birger Koblitz wrote:
> 
> Hi,
> 
> use the following script:
> test.C:
> // Test of CINT
> {
>   testit(){
>     float sum;
> 
>     TH1F *h=new TH1F("h02","H02",100,0,1);
>     for (int i=1;i<101;i++) h->SetBinContent(i,sin(i));
>     h->Scale(1./h->Integral());
>   }
> }
> 
> Then start root and type:
> .L test.C
> testit()
> float sum=0.
> float s=0.
> for(int ll=1; ll<101; ll++){s=h02->GetBinContent(ll);sum=sum+s;};
> sum
>      (gives 1.0)
> sum=0.
> for(int ll=1; ll<101; ll++){sum+=h02->GetBinContent(ll);};
>      (seems to crash now!)
> 
> Cheers,
>   Birger
> 
> On Wed, 17 Apr 2002, Rene Brun wrote:
> 
> > Hi Birger,
> >
> > I cannot reproduce this problem. Could you send me a script
> > that i could use to investigate?
> >
> > Rene Brun
> 
>  ------------------------------------------------------------
>  Birger Koblitz   koblitz@mail.desy.de  ("-/")_.-'"-._
>  MPI für Physik                          . . ; -._    )-;-,_)
>  c/o DESY-FH1     Tel. (40) 8998-3971   (v_,)'  _  )-.\  -'
>  Notkestr. 85                          _.- _..-_/ / ((.'
>  D-22603  HAMBURG                    ((,.-'   ((,/



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:50 MET