Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2076

fn:ceiling does not work on xs:decimal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • Back End
    • None

    Description

      The fn:ceiling function (and likely other related functions that do rounding-like operations) does not correctly work on xs:decimal's. For example:

      fn:ceiling(xs:decimal(0.125))
      

      results in 0.125. The expected value is 1.

      Floats and doubles do round correctly, so a temporary work around is to cast any decimals that are passed into fn:ceiling to xs:doubles.

      Note that commit a20ff4172807f5e0264ce68142f15f9798df1e8b changed the behavior of div to always return an xs:decimal instead of an xs:float/double, so any functions that try to fn:ceiling a division will likely run into this issue and require the xs:double cast as a workaround.

      Attachments

        Activity

          People

            dfthompson Dave Thompson
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: