This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9605 - provide positive zero as an alternate result for tests expecting negative zero
Summary: provide positive zero as an alternate result for tests expecting negative zero
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.2
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-28 14:49 UTC by Sorin Nasoi
Modified: 2010-06-11 10:23 UTC (History)
0 users

See Also:


Attachments
This is a list of tests for fn:round that do not provide alternate results 0 and -0 (4.46 KB, text/plain)
2010-04-28 14:49 UTC, Sorin Nasoi
Details

Description Sorin Nasoi 2010-04-28 14:49:34 UTC
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.
Comment 1 Andrew Eisenberg 2010-06-10 21:37:42 UTC
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.