<?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>29401</bug_id>
          
          <creation_ts>2016-01-29 00:04:02 +0000</creation_ts>
          <short_desc>[QT3] numeric-unary return type</short_desc>
          <delta_ts>2016-03-04 10:14:08 +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>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Benito van der Zander">benito</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>andrew_coleman</cc>
    
    <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>124734</commentid>
    <comment_count>0</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-01-29 00:04:02 +0000</bug_when>
    <thetext>Seems no one is looking at #23229 anymore

The QT3 also has the tests op-numeric-unary-minus-1 and op-numeric-unary-plus-1 that do not allow xs:integer where a xs:decimal is expected.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124751</commentid>
    <comment_count>1</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-01-30 02:30:58 +0000</bug_when>
    <thetext>I don&apos;t think these tests are wrong, according to B.2 Operator Mapping, if the operands are of the same type (where type is xs:integer, xs:decimal, xs:float, xs:double, in that order), the result type after the calculation is applied must also be of that same type.

For this test, I believe the only possible outcome is &quot;integer decimal float double double&quot;. What other outcome do you suggest is also valid and why?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124761</commentid>
    <comment_count>2</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-01-30 10:03:13 +0000</bug_when>
    <thetext>Since integer is a subtype of decimal, every integer has the type decimal. So everywhere where a decimal occurs, you can just put an integer.

(It could be used as optimization if there is a faster evaluation path for integers)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124763</commentid>
    <comment_count>3</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-01-30 21:35:55 +0000</bug_when>
    <thetext>&gt; Since integer is a subtype of decimal, every integer has the type decimal
I agree, but I&apos;m not sure how that influences the result in this test, I&apos;m afraid I&apos;m missing the point here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124771</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-01-31 16:52:30 +0000</bug_when>
    <thetext>Abel, the point is that if $X is a decimal, then we require that -$X and +$X return a decimal, but this does not preclude them returning an integer, because an integer is a decimal and therefore satisfies the requirement. But the test is written to fail if the returned value is an integer.

I have committed a change to the test to use xs:decimal(2.5) rather than xs:decimal(2) so that the question does not arise. Leaving the bug open in case others disagree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125359</commentid>
    <comment_count>5</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2016-03-04 10:14:08 +0000</bug_when>
    <thetext>I am marking this bug as resolved as we have reached our resolution</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>