Uploaded image for project: 'Commons JXPath'
  1. Commons JXPath
  2. JXPATH-102

Core rounding functions don't handle NaN or infinite values correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.3
    • None

    Description

      assertXPathValue(context, "floor('NaN')", new Double(Double.NaN));
      assertXPathValue(context, "floor(-2 div 0)", new Double(Double.NEGATIVE_INFINITY));
      assertXPathValue(context, "floor(2 div 0)", new Double(Double.POSITIVE_INFINITY));

      assertXPathValue(context, "ceiling('NaN')", new Double(Double.NaN));
      assertXPathValue(context, "ceiling(-2 div 0)", new Double(Double.NEGATIVE_INFINITY));
      assertXPathValue(context, "ceiling(2 div 0)", new Double(Double.POSITIVE_INFINITY));

      assertXPathValue(context, "round('NaN')", new Double(Double.NaN));
      assertXPathValue(context, "round(-2 div 0)", new Double(Double.NEGATIVE_INFINITY));
      assertXPathValue(context, "round(2 div 0)", new Double(Double.POSITIVE_INFINITY));

      Attachments

        1. patch.txt
          1 kB
          Sergey Vladimirov
        2. testcase-patch.txt
          2 kB
          Sergey Vladimirov

        Activity

          People

            Unassigned Unassigned
            bsp Sergey Vladimirov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: