Re: mult version 3.8

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Wed Nov 28 2001 - 12:33:10 EST

  • Next message: Stephen J. Sanders: "Where is draft 3.9!"

    Hi Djam, 
    
    On Wed, 28 Nov 2001 16:03:56 +0100 (CET)
    Djamel Ouerdane <ouerdane@nbi.dk> wrote
    concerning "Re: mult version 3.8":
    > Maybe things have a bit changed with the latest version of root but when I 
    > used to put e.g. TPad::SetTopMargin(0), it didn't work properly in a 
    > macro. I had to put e.g. TPad::SetTopMargin(0.00001)
    > 
    > Perhaps 0. should be ok since cint "sees" 0 like an int (try in a root 
    > session 1/2 and 1./2.)
    
    
    Erh, I think you misunderstood something in C++ Djam: 
    
      The literal  1 / 2 == 0 
      The literal  1. / 2 == .5 
      The literal  1. / 2. == .5 
    
    That is, it's not a CINT thing, but a C/C++ thing.  Try this program,
    and you'll see it 
    
      #ifndef __IOSTREAM__
      #include <iostream>
      #endif
    
      int main(int argc, char** argv) {
        Float_t a = 1 / 2;   // This gives 0 
        Float_t b = 1. / 2;  // This gives .5 
        Float_t c = 1 / 2.;  // This gives .5 
        Float_t d = 1. / 2.; // This gives .5 
        
        cout << " a = 1 / 2 " << a << endl 
    	 << " b = 1. / 2 " << b << endl 
    	 << " c = 1 / 2. " << c << endl 
    	 << " d = 1. / 2. " << d << endl;
        return 0;
      }
    
    I don't think that CINT 'sees' anything, and I certainly don't believe
    that this was the cause of your problem :-). 
    
    For Steve, no there's no way to set the format on the axis as far as I
    can see, but you should check the manual and roottalk.  If you find
    nothing, chances are it's not implmented, and you should ask Fons and
    Rene for that feature. 
    
    And Micheal, in ROOT, the value '0' does _not_ normally mean the
    default value, as one can actually set default values in C++.  And I
    like the reference to PAW as ROOT--.  Actually, it'd be more
    appropiate to say that CERNLIB is ROOT--, but that's another deal. 
    
    Yours, 
    
    Christian Holm Christensen -------------------------------------------
    Address: Sankt Hansgade 23, 1. th.           Phone:  (+45) 35 35 96 91 
             DK-2200 Copenhagen N                Cell:   (+45) 28 82 16 23
             Denmark                             Office: (+45) 353  25 305 
    Email:   cholm@nbi.dk                        Web:    www.nbi.dk/~cholm
    



    This archive was generated by hypermail 2b30 : Wed Nov 28 2001 - 12:33:58 EST