W3C home > Mailing lists > Public > public-xformsusers@w3.org > November 2017

Re: 4.3.6 The power() Function

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Mon, 6 Nov 2017 09:29:00 -0800
Message-ID: <CAAc0PEW+SMjH2S3qugrvLF=C4NyeBhrQG4JdP-i2ZmsoXSfEEA@mail.gmail.com>
To: Nick Van den Bleeken <Nick.Van.den.Bleeken@inventivegroup.com>
Cc: Steven Pemberton <steven.pemberton@cwi.nl>, XForms <public-xformsusers@w3.org>
+1 to follow XPath functions and operators.

On Mon, Nov 6, 2017 at 1:16 AM, Nick Van den Bleeken <
Nick.Van.den.Bleeken@inventivegroup.com> wrote:

> Steven,
>
> As far as I can see XPath functions and operators agrees with your
> proposal. They have some more examples of ‘corner’ cases:
> https://www.w3.org/TR/xpath-functions-31/#func-math-pow
>
> Regards,
>
> Nick Van den Bleeken
>
>
> On 06/11/2017, 10:04, "Steven Pemberton" <steven.pemberton@cwi.nl> wrote:
>
>
>     https://www.w3.org/community/xformsusers/wiki/XPath_
> Expressions_Module#The_power.28.29_Function
>
>     Looking at the test case for power() I note a couple of weakly
> specified
>     cases:
>
>         power(0, 0): 0 or 1? We don't say, but I propose that we say that
> it is
>     1. See https://www.math.hmc.edu/funfacts/ffiles/10005.3-5.shtml
>
>     Secondly we say:
>
>     "Both arguments may be fractional and negative. If the calculation does
>     not result in a real number, then NaN is returned."
>
>     This is underspecified.
>
>     power(4, 0.5) could result in either of two values, -2 or 2. I propose
> we
>     say that it returns 2.
>
>     power(-1, 0.5) also has two possible results, neither of which is
> real, so
>     it clearly returns NaN.
>
>     power(-1, 0.2) has 5 possible results, four of which are not real, but
> one
>     of which is real (-1).
>
>     One possible wording is
>
>     "Both arguments may be fractional and negative. If the possible results
>     are real, it returns the positive one. Otherwise it returns NaN."
>
>     Steven
>
>
>
>
Received on Monday, 6 November 2017 17:29:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:37:48 UTC