[ROOT-8110] TFormula in v6 performs integer division where it used to perform real division in v5 Created: 08/Apr/16 Updated: 18/Apr/16 Resolved: 17/Apr/16
|Reporter:||Gianluca Petrillo||Assignee:||Lorenzo Moneta|
ROOT 5's TFormula used to interpret all literal numbers in its expression as double.
ROOT 6's TFormula seems to more strictly adhere to a C syntax, and the same line executes "1/2*2" and return "0.0".
This is a serious compatibility break, very easy to be missed.
|Comment by Lorenzo Moneta [ 17/Apr/16 ]|
I am sorry, but I prefer to not restore that behaviour. The new TFormula uses Cling as C++ parser so it is correct to get what you would get in written code. I hope this problem can be fixed without too much work by you
|Comment by Gianluca Petrillo [ 18/Apr/16 ]|
The biggest problem is that we don't even know where TFormula is internally used in ROOT.
I understand you don't want to restore the old behaviour.
|Comment by Lorenzo Moneta [ 18/Apr/16 ]|
Can you please elaborate more on your usage ? Internally TFormula might be used, but it is the user at the end who inputs the expression, or are you reading functions from a file ?
In this last case one could think of building something to convert the expressions as 1/2 to 1.0/2. But doing this will require lots of work since we are not parsing the operations as before, but we leave this to the compiler.