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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.3
    • Labels:
      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. testcase-patch.txt
          2 kB
          Sergey Vladimirov
        2. patch.txt
          1 kB
          Sergey Vladimirov

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: