Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DFDL-1688

Expressions like 90.0 div 1234567.0 creating integer result 0, not a double or decimal.

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.0.0
    • 1.1.0
    • Front End
    • None

      Expression compiler was creating Long preferentially to double/bigDecimal in all cases, even if the literal had a trailing ".0" in the syntax.

      This causes bugs because expressions like 90.0 div 100000.0 produce 0 as a Long integer as both arguments are taken to be Long and div is then integer division.

      The result is you end up dividing by zero, which unfortunately, is a processing error causing backtracking when parsing. So the symptom is often that some array element is not parsed, or some choice is taken wrong.

      A trace will show what is happening, but it would be a mystery as to why unless you put daf:trace all over your expressions to see the values they are producing.

              jadams Joshua Adams
              mbeckerle.dfdl Mike Beckerle
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: