This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
math:sqrt is incorrectly listed in section 4.7 "Trigonometric functions" 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 "trigonometric functions. Dimitre Novatchev
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'm maintaining a tradition. But I'll try to do better.
I changed the section heading to "trigonometric and other mathematical". The WG agreed this was editorial, and it has been reclassified accordingly.
(In reply to comment #2) > I changed the section heading to "trigonometric and other mathematical". > 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
(In reply to comment #3) [note this is not a WG comment, just an interested observer] > While it is possible, presenting pi as a function seems weird and unnatural. Technically it's no different from having true() and false() as functions is it?
(In reply to comment #4) > (In reply to comment #3) > [note this is not a WG comment, just an interested observer] > > While it is possible, presenting pi as a function seems weird and unnatural. > Technically it's no different from having true() and false() as functions is > 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?
>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 "Math Functions" then it would immediately invite comment as to why a number of other functions were not present in this section. But I'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. > Presenting pi as a function seems weird and unnatural Interesting reaction: I'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(). >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'm sorry, I don't follow that argument: why is it bad to have a redundant representation of some numbers? Is it bad that in "2" and "+2" we have two redundant representations of the number 2? If you don't like presenting pi() as a function, what would you prefer?