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 3852 - K-NumericAdd-5 and K-NumericAdd-6 are bad tests
Summary: K-NumericAdd-5 and K-NumericAdd-6 are bad tests
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.1
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Frans Englich
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-19 11:26 UTC by John Snelson
Modified: 2007-01-12 16:18 UTC (History)
0 users

See Also:


Attachments

Description John Snelson 2006-10-19 11:26:14 UTC
I note that these tests have already been discussed in Bug #3346.

The tests follow this pattern (K-NumericAdd-6 uses float instead of double):

xs:double(1.1) + xs:double(2.2) ne 3.3

where the expected test result is "true".

I would suggest that this is a bad test since it assumes that the implementation's numeric format is base-2 based. If the underlying numeric format is base-10 based (as Berkeley DB XML's is), then the test will quite rightly give a result of "false".

Similarly, I believe it would be perfectly acceptable (and indeed usual) to provide a certain margin of tolerence when comparing base-2 based floating point numbers - for this very reason. Another XQuery processor's implementation could provide tolerence enough to also give a result of "false".

I suggest that the tests either be changed to use numbers that are a little less controversial, or that they are removed altogether.

John
Comment 1 Michael Kay 2006-10-19 11:50:10 UTC
The XQuery specification requires that float and double operations use [IEEE 754-1985] arithmetic. This leaves no tolerance for different results in the way you describe.
Comment 2 John Snelson 2006-10-19 12:13:17 UTC
I can't find a publicly available copy of IEEE 754-1985 - I'd like to take a look if you know where I can view it.
Comment 3 Frans Englich 2007-01-12 15:12:18 UTC
John, I did some brief googling, and this might be of help:

http://www.cs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF
http://en.wikipedia.org/wiki/IEEE_754

But yes, none of them are not the actual specification.

I am closing this report as INVALID, and refer to comment #2 and description in #3346 as rationalis.

John, if this resolution is acceptable, feel free to change the status of this report to CLOSED.

Frans