Re: Power function in TMath

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Wed, 21 Jul 2010 21:06:21 +0200


Hi Alexander,

what's in TMath is independent of what CINT does. So yes, I agree, this overload should be added to TMath and I believe Lorenzo is planning on doing that. I let him speak for himself, though :-) (He's just back from a conference and still catching up with emails, so please give him a day or two.)

Cheers, Axel.

On 7/21/10 8:40 PM, Alexander Voigt wrote:
> Hi Benjamin,
>

>> So if inside a ROOT macro you say pow(2, 2) or pow(2,2.) you should get
>> what you want (this doesn't even require you to include cmath since CINT
>> appears to already know about it).
>>
>> Not that using a ROOT macro probably won't give you the performance
>> boost seen by in that test since you don't have the full set of
>> optimizaitons available -- and if you would compile your code with ACLiC
>> or directly you could just use std::pow from cmath yourself.

>
> You are completely right, I could always use std::pow(double,int) for
> myself. I just thought, that it would be convenient for the users to
> have a TMath::Power(Double_t,Int_t) function in ROOT which is faster
> than TMath::Power(Double_t,Double_t) for integer exponents. The latter
> just encapsulates pow() from math.h, so, why not have
> std::pow(double,int) encapsulated in TMath? Ok, just a thought. :)
>
> Kind regards,
> Alexander Voigt
>
>
Received on Wed Jul 21 2010 - 21:06:26 CEST

This archive was generated by hypermail 2.2.0 : Thu Jul 22 2010 - 05:50:01 CEST