Unary minus precedence preference
|
07-23-2014, 01:45 PM
Post: #14
|
|||
|
|||
RE: Unary minus precedence preference
(07-23-2014 02:36 AM)John R Wrote:(07-22-2014 07:56 AM)Thomas Radtke Wrote: There is no proof. It's a convention. Finally, a well funded response. So one good reason to choose -2^2=-4 is to avoid unnecessary parenthesis and the ambiguity of: x-x^2 producing a different result from -x^2+x. Notice the first minus is a subtraction, while the second minus becomes a unary minus just by commutativity, so they are two different operators but the expressions are mathematically equivalent and should give the same result. This alone is reason enough to discard the other option as "incorrect", as a CAS cannot give 2 different results just for swapping terms in the expression. Thank, John, your argument is enough to convince me that there should NEVER be an option to do -2^2=4, because when used in more complex expressions it has disastrous consequences. Claudio |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)