<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>3852</bug_id>
          
          <creation_ts>2006-10-19 11:26:14 +0000</creation_ts>
          <short_desc>K-NumericAdd-5 and K-NumericAdd-6 are bad tests</short_desc>
          <delta_ts>2007-01-12 16:18:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0.1</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="John Snelson">john.snelson</reporter>
          <assigned_to name="Frans Englich">frans.englich</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12543</commentid>
    <comment_count>0</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2006-10-19 11:26:14 +0000</bug_when>
    <thetext>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 &quot;true&quot;.

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

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&apos;s implementation could provide tolerence enough to also give a result of &quot;false&quot;.

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

John</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12544</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-10-19 11:50:10 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12545</commentid>
    <comment_count>2</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2006-10-19 12:13:17 +0000</bug_when>
    <thetext>I can&apos;t find a publicly available copy of IEEE 754-1985 - I&apos;d like to take a look if you know where I can view it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13470</commentid>
    <comment_count>3</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2007-01-12 15:12:18 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>