Overflow in TMath.Abs(x)


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

The command
delivers as result

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:

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

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.