This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Created attachment 867 [details] This is a list of tests for fn:round that do not provide alternate results 0 and -0 http://www.w3.org/TR/xquery-operators/#func-round states that "In the cases where positive zero or negative zero is returned, negative zero or positive zero may be returned as [XML Schema Part 2: Datatypes Second Edition] does not distinguish between the values positive zero and negative zero." at least: - 52 tests for fn:round and - 2 tests for fn:round-half-to-even do not provide alternate results (0 and -0). See tests from the attached file. The tests were created by Frans Englich.
On June 8, the XML Query and XSL WGs considered the issue that you've raised. We find that F&O is inconsistent in its treatment of zero and negative zero. In Section 6.1 Numeric Types, for instance, we say: Note: This specification uses [IEEE 754-1985] arithmetic for xs:float and xs:double values. This differs from [XML Schema Part 2: Datatypes Second Edition] which defines NaN as being equal to itself and defines only a single zero in the value space while [IEEE 754-1985] arithmetic treats NaN as unequal to all other values including itself and can produce distinct results of positive zero and negative zero. (These are two different machine representations for the same [XML Schema Part 2: Datatypes Second Edition] value.) The text accompanying several functions discusses behaviour for both positive and negative zero inputs and outputs in the interest of alignment with [IEEE 754-1985]. Some of our functions allow either zero or negative zero to be returned, while others allow only one of these values. The WGs will not make any changes in this area for F&O 1.0/2.0. We will consider making such changes in F&O 1.1/2.1. We will not change the expected results that you have identified in the XQuery Test Suite. Instead, we will change our guidelines to allow a test harness to substitute "0" for "-0" in expected results before comparing them to its actual results. Please close this bug report if you accept this resolution of your issue.