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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 2.0.0
    • Component/s: Front End
    • Labels:
      None

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Tasks