<?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>3528</bug_id>
          
          <creation_ts>2006-07-24 16:54:39 +0000</creation_ts>
          <short_desc>additional expected values for decimal operations, part 2</short_desc>
          <delta_ts>2006-08-03 20:35:30 +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>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</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>
          <dependson>3443</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andrew Eisenberg">andrew.eisenberg</reporter>
          <assigned_to name="Carmelo Montanez">carmelo</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>10724</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2006-07-24 16:54:39 +0000</bug_when>
    <thetext>In #3443, I reported a number of test cases for which I felt additional results were justified. I&apos;d like to add to that list and suggest that test cases support the following additional values:

Test Case                      Existing value          Additional Value
extvardeclwithouttype-18       2.333333333333333333    2.333333333333
extvardeclwithtype-18          2.3333333               2.33333
fn-avg-mix-args-009            -50.5000000000005       -50.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10738</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-07-24 17:57:53 +0000</bug_when>
    <thetext>Concerning extvardeclwithouttype-18, this effectively returns the result of (7 div 3) (which is an xs:decimal). This is governed by the rule:

For xs:decimal values the number of digits of precision returned by the numeric operators is ·implementation-defined·. If the number of digits in the result exceeds the number of digits that the implementation supports, the result is truncated or rounded in an ·implementation-defined· manner.

Implementations are required to support at least 18 digits. My reading is that you have to take the two sentences together, and this means that the result of the division must be at least 18 digits. Therefore the result 2.333333333333
is wrong. 

On a more practical point, however, it&apos;s clear that there are an infinite number of correct results for this query. The simplest solution would therefore be to change the query so that instead of computing avg(4,2,1), it computes avg(8,4,2,1), which is incontrovertibly 7.5.

Concerning extvardeclwithtype-18, the result here is the decimal value of (8 div 3) converted to a float. Similar considerations therefore apply. 

Concerning fn-avg-mix-args-009 teh query here is:

fn:avg( ( ( xs:decimal(&quot;-1.000000000001&quot;), xs:integer(&quot;-100&quot;))))

The correct answer to this can be expressed exactly in 15 decimal digits of precision, and since all products are required to support this number of digits, I do not think any answer other than -50.5000000000005 is acceptable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10741</commentid>
    <comment_count>2</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2006-07-24 20:45:47 +0000</bug_when>
    <thetext>Carmelo, please add these expected results to their associated test cases. We can remove them once we have a rulin gfrom the XSL and XML Query WGs.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10801</commentid>
    <comment_count>3</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-07-25 19:24:45 +0000</bug_when>
    <thetext>All:

Added extra values and will leave bug open, pending a resolution of
the Working Group.

Thanks,
Carmelo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10803</commentid>
    <comment_count>4</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2006-07-25 22:00:40 +0000</bug_when>
    <thetext>Found one more of these

Test Case                           Existing value        Additional Value
op-divide-dayTimeDuration-by-dTD-1  1.437834967320261     1.4378349673</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>10848</commentid>
    <comment_count>5</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2006-07-27 16:52:30 +0000</bug_when>
    <thetext>I keep thinking that I&apos;ve found the last of these, but ...

Test Case                           Existing value         Additional Value
op-numeric-dividesht2args-5         -1.000030518509475997  -1.000030518509
op-divide-dayTimeDuration-by-dTD-1  1.437834967320261      1.4378349673


I&apos;ve added the additional expected results to these test cases, so no further action is required until we get a ruling from the WGs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11017</commentid>
    <comment_count>6</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-08-03 20:35:30 +0000</bug_when>
    <thetext>As per the working groups decison to allow arbitrary number of
digits. 15 digits is acceptable for these types of decimal operations.

I am marking this bug as closed.  Any implementatin that differs from the given outcomes should provide those to the Task force.

Thanks,
Carmelo</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>