Post Reply 
Unary minus precedence preference
07-23-2014, 01:59 AM
Post: #8
RE: Unary minus precedence preference
(07-21-2014 08:00 PM)Claudio L. Wrote:  While symbolic object support in newRPL is getting ready to be released in a new demo, I stumbled upon the unary minus precedence ambiguity:

Excel does: -2^2 = 4
while almost everybody else give -2^2= -4

I implemented it as -2^2=-4 for the time being (just to follow the herd), but are there any good reasons to choose one precedence or the other?

Are there any other ambiguities that I need to be aware of regarding other operators?

Claudio

A way to remember the order of operations is to use the acronym PEMDAS Observe that PEMDAS is formed using the first letter of each of the above operators. (Parentheses, Exponents, Multiplication and Division, Addition and Subtraction). Even tho 50g says no, you gotta subtract last.

Thanks
~~~~8< Art >8~~~~

PS: Please post more 50G stuff :)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Unary minus precedence preference - CosmicTruth - 07-23-2014 01:59 AM



User(s) browsing this thread: 3 Guest(s)