This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
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.
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.
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