Re: Power function as operator
| From: | Chris London | Date: | Fri, 22 Nov 2013 22:27:26 +0000 |
| Subject: | Re: Power function as operator | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70300@lists.php.net to get a copy of this message | ||
On Fri, Nov 22, 2013 at 3:17 PM, Niel Archer <spam-free@blueyonder.co.uk>wrote:
> Hi,
>
>
> > So:
> > -3 ** 2 == -9
>
> Shouldn't this be +9
>
>
Unfortunately no,
https://www.google.com/search?q=-3+%5E+2
What it is doing is -(3 ** 2). If you want +9 you'd have to do (-3) ** 2