<?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>4309</bug_id>
          
          <creation_ts>2007-02-08 14:23:51 +0000</creation_ts>
          <short_desc>fn-insert-before-mix-args-010 has invalid float value</short_desc>
          <delta_ts>2007-09-12 10:37:40 +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.2</version>
          <rep_platform>Other</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="Frans Englich">frans.englich</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>13928</commentid>
    <comment_count>0</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2007-02-08 14:23:51 +0000</bug_when>
    <thetext>fn-insert-before-mix-args-010&apos;s query reads:

fn:insert-before( (&quot;a&quot;, &quot;b&quot;, &quot;c&quot;),2, xs:float(&quot;-0&quot;)) 

the expected base line is: &quot;a 0 b c&quot;

To me this seems wrong. 17.1.2 Casting to xs:string and xs:untypedAtomic reads:
&quot;If SV has the value positive or negative zero, TV is &quot;0&quot; or &quot;-0&quot; respectively.&quot;

Saxon evaluates the above to &quot;a -0 b c&quot;, which is what I would expect.

In revision 1.5 of the file, the baseline changed from -0.0E0 to 0, without documenting why:

http://dev.w3.org/cvsweb/2006/xquery-test-suite/TestSuiteStagingArea/ExpectedTestResults/Functions/SeqFunc/GeneralSeqFunc/SeqInsertBeforeFunc/fn-insert-before-mix-args-010.txt.diff?r1=1.4&amp;r2=1.5&amp;f=h


Frans</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13929</commentid>
    <comment_count>1</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2007-02-08 14:28:09 +0000</bug_when>
    <thetext>To be a bit more specific: the baseline reading &quot;a 0 b c&quot; should be removed, unless I&apos;m not mistaken.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13930</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-02-08 15:32:14 +0000</bug_when>
    <thetext>IIRC the spec says that when casting the string &quot;-0&quot; to float, it&apos;s implementation-defined whether you get negative or positive zero. (The reason is to do with the fact that Schema 1.0 doesn&apos;t have a distinct negative zero in the value-space)

The change from 0.0e0 to 0 was to fix a bug: floating point zero when converted to a string should give you &quot;0&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13931</commentid>
    <comment_count>3</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2007-02-08 18:12:09 +0000</bug_when>
    <thetext>Ok. In that case the paragraph in 17.1.2 contradicts it, since it makes a distinction for positive and negative zero. It would be cool with a pointer to where it&apos;s mentioned how this serialization is implementation defined.

Maybe a candidate for errata.


Frans
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16482</commentid>
    <comment_count>4</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2007-09-12 09:44:24 +0000</bug_when>
    <thetext>Mike, section 17.1.2 Casting to xs:string and xs:untypedAtomic reads:

If ST is xs:float or xs:double, then:
If SV has the value positive or negative zero, TV is &quot;0&quot; or &quot;-0&quot; respectively.

doesn&apos;t this mandate that xs:float(&quot;-0&quot;) must serialize to &quot;-0&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16484</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-09-12 09:59:14 +0000</bug_when>
    <thetext>xs:float(&quot;-0&quot;) is allowed to return positive or negative zero. This was decided because XML Schema 1.0 doesn&apos;t actually recognize negative zero.

If it returns negative zero then it must serialize as &quot;-0&quot;; if it returns positive zero then it must serialize as &quot;0&quot;.

Michael Kay</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16490</commentid>
    <comment_count>6</comment_count>
    <who name="Frans Englich">frans.englich</who>
    <bug_when>2007-09-12 10:37:14 +0000</bug_when>
    <thetext>I see. Rejecting.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>