<?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>14905</bug_id>
          
          <creation_ts>2011-11-22 14:42:02 +0000</creation_ts>
          <short_desc>[QT3] math-exp-003</short_desc>
          <delta_ts>2011-11-25 14:22:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Member-only Editors Drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</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="Tim Mills">tim</reporter>
          <assigned_to name="Benjamin Nguyen">benjie.nguyen</assigned_to>
          <cc>mike</cc>
          
          <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>60350</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-11-22 14:42:02 +0000</bug_when>
    <thetext>I fail this test because our implementation gives the result as

2.718281828459045e0

Looking at the representation of the values using System.BitConverter.DoubleToInt64Bits (.NET) or java.lang.Double.doubleToRawLongBits (Java) I get:

Expected result = 4613303445314885482

Actual result = 4613303445314885481

The bit pattern for System.Math.E (.NET) or java.lang.Math.E (Java) is 4613303445314885481.

    &lt;test-case name=&quot;math-exp-003&quot;&gt;
        &lt;description&gt;Evaluate the function exp() with the argument set to 1&lt;/description&gt;
        &lt;created by=&quot;O&apos;Neil Delpratt, Saxonica&quot; on=&quot;2010-12-10&quot;/&gt;        
        
        &lt;test&gt;math:exp(1)&lt;/test&gt;
        &lt;result&gt;
            &lt;assert-eq&gt;2.7182818284590455e0&lt;/assert-eq&gt;
        &lt;/result&gt;
    &lt;/test-case&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60399</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-11-23 19:47:16 +0000</bug_when>
    <thetext>It appears that in Java, the expression

Math.exp(1.0e0) == Math.E

returns false ;-(

I&apos;m not sure exactly what the IEEE spec has to say about the required precision of the result: it needs a lot of study to decipher the meaning. Pragmatically, it would appear to make sense for our expected result to tolerate the value that the Java library delivers, as well as what would appear to be the &quot;correct&quot; result. So I propose to change the test to allow an epsilon variation in the result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60401</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-11-23 19:59:03 +0000</bug_when>
    <thetext>Changed test to allow a variation of 1e-15 in the result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60492</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2011-11-25 14:22:04 +0000</bug_when>
    <thetext>Confirmed fixed.  Thanks.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>