<?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>10072</bug_id>
          
          <creation_ts>2010-07-03 03:04:48 +0000</creation_ts>
          <short_desc>math:sqrt incorrectly listed in section 4.7 &quot;Trigonometric functions&quot;</short_desc>
          <delta_ts>2010-07-13 22:20:38 +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>Functions and Operators 3.0</component>
          <version>Working drafts</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xpath-functions-11/#func-sqrt</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>dnovatchev</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>davidc</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>36553</commentid>
    <comment_count>0</comment_count>
    <who name="">dnovatchev</who>
    <bug_when>2010-07-03 03:04:48 +0000</bug_when>
    <thetext>math:sqrt is incorrectly listed in section 4.7 &quot;Trigonometric functions&quot; http://www.w3.org/TR/xpath-functions-11/#func-sqrt.

It is well-known that the sqrt() function is in the clas of exponential functions -- x^a, where a = 1/2.

Therefore, this function should not be listed under &quot;trigonometric functions.


Dimitre Novatchev</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36556</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-03 11:29:30 +0000</bug_when>
    <thetext>Thanks for the observation. I may have been influenced by the fact that the categorization of the functions in the 2.0/1.0 spec is hopelessly illogical, and serves very little useful purpose. So at least I&apos;m maintaining a tradition. But I&apos;ll try to do better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36784</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-13 11:31:02 +0000</bug_when>
    <thetext>I changed the section heading to &quot;trigonometric and other mathematical&quot;.

The WG agreed this was editorial, and it has been reclassified accordingly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36785</commentid>
    <comment_count>3</comment_count>
    <who name="">dnovatchev</who>
    <bug_when>2010-07-13 12:54:46 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I changed the section heading to &quot;trigonometric and other mathematical&quot;.
&gt; The WG agreed this was editorial, and it has been reclassified accordingly.

While this is a step in the right direction, the new heading sounds ... strange.

The right solution is to have:

   Math Functions
     Exponential
     Trigonometric

Or, even better:

   Math Functions and Constants
     Constants
     Functions
         Exponential
         Trigonometric

While it is possible, presenting pi as a function seems weird and unnatural. Following this path we should have:

  math:one()
  math:zero()
  math:two()
  math:e()
  math:pi()
  math:ten()

Then, the next step would be to forbid writing:1, 0, 2, 10, or considering this unnatural.

Going in this direction would be considered wrong by most programmers and may hurt the serious adoption of XPath, XQuery and XSLT.

Dimitre Novatchev</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36787</commentid>
    <comment_count>4</comment_count>
    <who name="David Carlisle">davidc</who>
    <bug_when>2010-07-13 13:12:26 +0000</bug_when>
    <thetext>(In reply to comment #3)

[note this is not a WG comment, just an interested observer]




&gt; While it is possible, presenting pi as a function seems weird and unnatural.

Technically it&apos;s no different from having true() and false() as functions is it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36789</commentid>
    <comment_count>5</comment_count>
    <who name="">dnovatchev</who>
    <bug_when>2010-07-13 13:39:32 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; [note this is not a WG comment, just an interested observer]
&gt; &gt; While it is possible, presenting pi as a function seems weird and unnatural.
&gt; Technically it&apos;s no different from having true() and false() as functions is
&gt; it?

In fact it *is* different. We do not have two literal boolean values but we do have numeric literals.

While the constructors true() and false() give us a *unique* representation of all possible boolean values, introducing functions to represent numerical constants results in a *redundant* representation for some numerical values.

Maybe we should be aware that there are some issues arising from redundancy?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36816</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-07-13 22:20:38 +0000</bug_when>
    <thetext>&gt;The right solution is to have:

   Math Functions
     Exponential
     Trigonometric

The section structure of this document was designed, I think, to help readers find their way around the spec, not to provide a rigorous taxonomy of the functions on offer. As a taxonomy, the hierarchy considered as a whole is indefensible; if we had a section headed &quot;Math Functions&quot; then it would immediately invite comment as to why a number of other functions were not present in this section.

But I&apos;m going to have to reconsider the section headings anyway as the WG has today decided to add a number of other functions such as exp, log, and pow.

&gt; Presenting pi as a function seems weird and unnatural

Interesting reaction: I&apos;m surprised by it. I have to say that to me presenting a constant as a zero-argument function seems entirely natural. The only other way of doing it that comes to mind is a built-in global variable, and that seems less consistent with other design decisions made in the language, notably the presentation of true() and false(). 

&gt;While the constructors true() and false() give us a *unique* representation of
all possible boolean values, introducing functions to represent numerical
constants results in a *redundant* representation for some numerical values.

I&apos;m sorry, I don&apos;t follow that argument: why is it bad to have a redundant representation of some numbers?  Is it bad that in &quot;2&quot; and &quot;+2&quot; we have two redundant representations of the number 2? 

If you don&apos;t like presenting pi() as a function, what would you prefer?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>