Re: rfc: pow-operator

From: Date: Sun, 24 Nov 2013 01:15:26 +0000
Subject: Re: rfc: pow-operator
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-70339@lists.php.net to get a copy of this message
On Sun, Nov 24, 2013 at 1:58 AM, Kris Craig <kris.craig@gmail.com> wrote: > I don't see any benefit in using Python's unique behavior as a model. they aren't the only ones doing it that way, there were a bunch of languages mentioned for left, right and no associativity, maybe it would be useful to list them on the rfc page. > The > model should conform to established mathematical laws, not some other > arbitrarily chosen scripting language. the power tower comes from mathematical laws, and that would support the right association, as mentioned by Jakub in the other thread. > According to Order of Operations, > all operations of the same type within the same context (parentheses) must > be processed in order from left to right. For example, -2 ** 3 ** 2 would > be processed from left to right, like this: pow( pow( -2, 3 ), 2 ); > see above, and this was also discussed in the other thread. > > We've introduced multiple options into RFCs before without encountering the > problems you mention. The alternative would be to create a separate RFC > that calls for behavior that conforms to established arithmetic standards.. > But it makes more sense to me to put that into one RFC rather than having > two separate threads to discuss what should be one single issue. > > --Kris > > I think it would make sense to extend the rfc with the issues brought up, and answer them there, because it seems that we started repeating the same arguments pro and con. ps: please don't top post. -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.internals (#70339) next »