Re: Re: power operator (again)
| From: | Levi Morrison | Date: | Thu, 19 Dec 2013 23:08:48 +0000 |
| Subject: | Re: Re: power operator (again) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70774@lists.php.net to get a copy of this message | ||
On Thu, Dec 19, 2013 at 2:50 PM, Kris Craig <kris.craig@gmail.com> wrote:
> On Thu, Dec 19, 2013 at 4:33 AM, Daniel Lowrey <rdlowrey@gmail.com> wrote:
>
> > > Thanks for all your effort! Unfortunately, since there's no option for
> > > negative numbers to intuitively square to positive outcomes, my vote is
> > > still No. I understand and respect your reasoning even though I do not
> > > agree with it.
> >
> > To me this is not a question of "intuitive" vs. "unintuitive" ... -3^2
> > =
> -9
> > is how the preponderance of credible resources evaluate the expression.
> As
> > far as I can tell voting "no" on this basis is equivalent to me claiming
> > the earth is flat because it better fits my world-view.
>
>
> That's a faulty analogy. In mathematics, the square of any number,
> positive or negative, yields a positive result. Any scientific or graphing
> calculator will match that behavior. I did sqr(-3) in the Windows
> Calculator just now and it outputted 9, not -9.
>
The problem here is that
pow(-3, 2) is equivalent to the expression `(-3)
** 2, not -(3 **2). Said differently, -3 ** 2` is equivalent to
-pow(3,2) and not pow(-3,2).
Hopefully this helps.