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 9907 - [FO11] Inconsistent treatment of zero and negative zero
Summary: [FO11] Inconsistent treatment of zero and negative zero
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.0 (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 21:42 UTC by Andrew Eisenberg
Modified: 2010-06-15 20:51 UTC (History)
0 users

See Also:


Attachments

Description Andrew Eisenberg 2010-06-10 21:42:11 UTC
Bug #9605 identified inconsistencies in our treatment of zero and negative
zero in F&O 1.0/2.0. The XML Query and XSL WGs decided on June 8 to defer consideration of this issue to F&O 1.1/2.1.
Comment 1 Michael Kay 2010-06-10 23:14:24 UTC
I suggest resolving this as follows.

1. In DM 1.1, perhaps in a new subsection of 2.6, state that: the xs:float and xs:double data types as used in DM have the same value space as in XSD 1.1, specifically they include both negative and positive zero, and in this respect they differ from XSD 1.0. To accommodate this difference, when converting from an xs:string to an xs:float or xs:double, it is implementation-defined whether the lexical value "-0" (and similar forms such as "-0.0") convert to negative zero or to positive zero in the value space.

2. In FO 1.1:

2.1 In 4.1 (numeric types), change the Note to explain the treatment of negative zero

2.2 In 14.4.4 (fn:min) change the explanation of the example that uses negative zero

2.3 In 17.1 (constructor functions) change the explanation of how the constructor functions for xs:float and xs:double handle negative zero: specifically, that the XSD 1.1 mapping of "-0" to negative zero is preferred, but that mapping the lexical representation "-0" to positive zero is acceptable for compatibility with XSD 1.0 processors.

2.4 In 18.1.3.1 (casting to xs:float) change the Note likewise

2.5 In 18.1.3.2 (casting to xs:double) change the Note likewise

Note that the original problem identified in bug #9605 with the wording of fn:round has already been fixed as a side-effect of the rewriting of the rules for this function when the optional second argument was introduced.
Comment 2 Michael Kay 2010-06-15 20:51:03 UTC
The proposal in comment #1 was accepted, with the amendment that we should recommend that string-to-double conversion converts "-0" to negative zero, while permitting conversion to positive zero where necessary e.g. where constrained by an XSD 1.0 PSVI implementation.

As the originator was present at the meeting I am marking this as closed.