Unary minus precedence preference
|
07-23-2014, 03:14 AM
Post: #10
|
|||
|
|||
RE: Unary minus precedence preference
Do you take -2^2 to mean: (-2)^2, -(2^2), or 0-(2^2)?
I've always taught that unary minus is the last (and should be parsed as if it was that by a computer), even though it's usually written as the second. (I admit I came to this conclusion writing a compiler that emitted code for both one's and two's complement ALUs.) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)