RE:[Fwd: [ROOT] problem with operator prece

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Sun Sep 02 2001 - 01:51:28 MEST


Hello Hannes,

Thank you for reporting this problem. I fix this in
Cint5.15.11.

Masaharu Goto


>Date: Wed, 29 Aug 2001 12:31:36 +0200
>From: Fons Rademakers <Fons.Rademakers@cern.ch>
>To: Masaharu Goto <MXJ02154@niftyserve.or.jp>
>Subject: [Fwd: [ROOT] problem with operator precedence]
>
>Hi Masa,
>
>  can you have a look at this. Thanks.
>
>Cheers, Fons.
>
>-- 
>Org:    CERN, European Laboratory for Particle Physics.
>Mail:   1211 Geneve 23, Switzerland
>E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
>WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480
>-----------------------------------------------------------------------------
-
--
>Date: Wed, 29 Aug 2001 10:01:00 +0200
>From: Hannes SAKULIN <Hannes.Sakulin@cern.ch>
>Reply-To: Hannes SAKULIN <Hannes.Sakulin@cern.ch>
>To: ROOT Talk mailing list <roottalk@cern.ch>
>Subject: [ROOT] problem with operator precedence
>
>Hi! 
>I'll try to ask this question again, here as nobody seems to read the
>newsgroup root.cern.ch.
>Hannes.
>
>-------- Original Message --------
>Subject: problem with operator precedence?
>Date: Mon, 30 Jul 2001 15:45:07 +0200
>From: Hannes SAKULIN <Hannes.Sakulin@cern.ch>
>Organization: CERN
>Newsgroups: cern.root
>
>Hi,
>I am observing a very strange behavior with root Version 3.01/06 12 July
>2001 (from na49). It seems like the precedence of && over || is not
>followed in all
>cases. 
>
>The if expressions below should always evaluate to true but for some
>reason the second one evaluates to false when I call the function
>(RunGMT1_cutJul2001()) from within a loop. 
>
>The output of the test program looks like this:
>
>root [8] .x xx.C
>TRUE w. brackets   true without 
>TRUE w. brackets   false without
>*** oops !!! *** eta = 0.9
>TRUE w. brackets   false without
>*** oops !!! *** eta = 0.9
>
>
>Does anybody have an ides what is going wrong in my little example?
>
>Best Regards, Hannes Sakulin.
>
>
>void xx ()
>{
>  RunGMT1_cutJul2001();
>  for (int iev = 0; iev <2; iev++) {
>    RunGMT1_cutJul2001();
>  }
>}
>
>void RunGMT1_cutJul2001()
>{
>  float eta = .9;
>  bool xx;
>  if ( 1 && ( (eta > 0.98 && eta < 1.02) ||
>             (eta > 1.38 && eta < 1.42) ||
>             (eta > 0.88 && eta < 0.92) )) {
>    cout << "TRUE w. brackets   " ;
>    xx=true;
>  }
>  else {
>    cout << "FALSE w. brackets  " ;
>    xx=false;
>  }
>
>  if (1 && ( eta > 0.98 && eta < 1.02 ||
>            eta > 1.38 && eta < 1.42 ||
>            eta > 0.88 && eta < 0.92 ) ) { 
>    cout << "true without " << endl;
>  }
>  else
>    {
>      cout << "false without" << endl;
>      if (xx) cout << "*** oops !!! *** eta = " << eta << endl;
>
>    }
>}
>



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:59 MET