Overflow in TMath.Abs(x)

Hello,

yesterday in ran in a problem when I tried to use the TMath.Abs(x) method in PyROOT.

The command
ROOT.TMath.Abs(104125)
delivers as result
26947

It doesn’t matter if I run it on lxplus or on a local distribution the problem stays the same.

Is there an easy way to fix it (except for using pyhthon’s abs() method)?

Looks weird. Can you post a running small script, showing what you are doing exactly ?

Of course the C++ version is fine:

root [0] TMath::Abs(104125)
(Int_t) 104125
root [1] 

Yes, C++ is fine. For a minimal example, I’m doing the following:

python
>>> import ROOT
>>> ROOT.TMath.Abs(104125)
26947
>>> 

Yes, is an overload problem (the version for ‘short’ is selected). I have zero time to work on PyROOT atm. Please file a jira ticket (sft.its.cern.ch/jira/browse/ROOT) to keep track of this.

Aside: use Python’s builtin abs().

Done! Thanks for your response.