Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-8110

TFormula in v6 performs integer division where it used to perform real division in v5

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Won't Fix
    • Affects Version/s: 6.06/02
    • Fix Version/s: None
    • Component/s: Math Libraries
    • Labels:
      None
    • Environment:

      Linux

    • Development:

      Description

      ROOT 5's TFormula used to interpret all literal numbers in its expression as double.
      The following line evaluated a "1.0/2.0*2.0" and returned "1.0":

      root.exe -l <<< 'cout << TFormula("F", "1/2*2").Eval(0.) << endl;'

      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.
      Can the old behaviour be restored?

        Attachments

          Activity

            People

            • Assignee:
              moneta Lorenzo Moneta
              Reporter:
              f98957ffb41780c8d75c Gianluca Petrillo
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: