You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sergey Vladimirov (JIRA)" <ji...@apache.org> on 2007/08/23 12:20:30 UTC
[jira] Created: (JXPATH-102) Core rounding functions don't handle
NaN correctly
Core rounding functions don't handle NaN correctly
--------------------------------------------------
Key: JXPATH-102
URL: https://issues.apache.org/jira/browse/JXPATH-102
Project: Commons JXPath
Issue Type: Bug
Affects Versions: 1.3
Reporter: Sergey Vladimirov
Fix For: 1.3
Attachments: patch.txt, testcase-patch.txt
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));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (JXPATH-102) Core rounding functions don't handle
NaN or infinite values correctly
Posted by "Matt Benson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JXPATH-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Benson resolved JXPATH-102.
--------------------------------
Resolution: Fixed
> Core rounding functions don't handle NaN or infinite values correctly
> ---------------------------------------------------------------------
>
> Key: JXPATH-102
> URL: https://issues.apache.org/jira/browse/JXPATH-102
> Project: Commons JXPath
> Issue Type: Bug
> Affects Versions: 1.3
> Reporter: Sergey Vladimirov
> Fix For: 1.3
>
> Attachments: patch.txt, testcase-patch.txt
>
>
> 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));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JXPATH-102) Core rounding functions don't handle
NaN or infinite values correctly
Posted by "Matt Benson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JXPATH-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matt Benson updated JXPATH-102:
-------------------------------
Summary: Core rounding functions don't handle NaN or infinite values correctly (was: Core rounding functions don't handle NaN correctly)
The XPath spec is explicit on rounding, but less so on ceiling/floor. However, the spec claims to use IEEE 754 which expresses ceiling/floor in terms of rounding, so I agree that abiding by the same rules in all cases is reasonable. Thanks for the report, Sergey!
> Core rounding functions don't handle NaN or infinite values correctly
> ---------------------------------------------------------------------
>
> Key: JXPATH-102
> URL: https://issues.apache.org/jira/browse/JXPATH-102
> Project: Commons JXPath
> Issue Type: Bug
> Affects Versions: 1.3
> Reporter: Sergey Vladimirov
> Fix For: 1.3
>
> Attachments: patch.txt, testcase-patch.txt
>
>
> 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));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JXPATH-102) Core rounding functions don't handle
NaN correctly
Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JXPATH-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Vladimirov updated JXPATH-102:
-------------------------------------
Attachment: patch.txt
> Core rounding functions don't handle NaN correctly
> --------------------------------------------------
>
> Key: JXPATH-102
> URL: https://issues.apache.org/jira/browse/JXPATH-102
> Project: Commons JXPath
> Issue Type: Bug
> Affects Versions: 1.3
> Reporter: Sergey Vladimirov
> Fix For: 1.3
>
> Attachments: patch.txt, testcase-patch.txt
>
>
> 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));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JXPATH-102) Core rounding functions don't handle
NaN correctly
Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JXPATH-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Vladimirov updated JXPATH-102:
-------------------------------------
Attachment: testcase-patch.txt
> Core rounding functions don't handle NaN correctly
> --------------------------------------------------
>
> Key: JXPATH-102
> URL: https://issues.apache.org/jira/browse/JXPATH-102
> Project: Commons JXPath
> Issue Type: Bug
> Affects Versions: 1.3
> Reporter: Sergey Vladimirov
> Fix For: 1.3
>
> Attachments: patch.txt, testcase-patch.txt
>
>
> 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));
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.