Re: Re: power operator (again)
| From: | Andrea Faulds | Date: | Thu, 19 Dec 2013 22:12:39 +0000 |
| Subject: | Re: Re: power operator (again) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-70765@lists.php.net to get a copy of this message | ||
On 19/12/13 21:58, Rasmus Lerdorf wrote:
No, the average PHP developer is going to do $var ** 2 and it will behave exactly as they expect with negative values. Yes, in the very rare case that someone for some reason hardcodes a negative literal there, they are going to have to learn about operator precedence because we really can't have 0 - 3**2 be different from - 3**2.We also, surely, cannot have -3**2 act differently from - 3 ** 2, for the same reason. -- Andrea Faulds http://ajf.me/