Re: rfc: pow-operator

From: Date: Sun, 24 Nov 2013 10:37:57 +0000
Subject: Re: rfc: pow-operator
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-70349@lists.php.net to get a copy of this message
On Sat, Nov 23, 2013 at 10:58 PM, Tjerk Meesters <tjerk.meesters@gmail.com>wrote: > > To support the latter "-3 ** 2 == 9" we would require a unary minus that > has a higher precedence than the exponent operator and as such falls > outside of the scope of this RFC. > > That said, I'm not even sure whether we can support a unary minus with the > current parser. > > Ok, I can accept that argument. I'm tempted to chase that unary rabbit down the hole further, but as you said that would take us off-topic. I'll just ask this, then: Hypothetically, if a unary minus for negative numbers was added in the future, how would that affect the behavior being discussed here with the proposed ** operator? I.e. if we had "-3 ** 2" with a unary minus, would the outcome be 9 or -9? --Kris

« previous php.internals (#70349) next »