(-) precedence
|
12-08-2022, 06:27 PM
(This post was last modified: 12-08-2022 06:29 PM by jhallen.)
Post: #10
|
|||
|
|||
RE: (-) precedence
(12-08-2022 05:43 PM)Thomas Okken Wrote: I think some of the confusion may stem from early textbooks that demonstrated parsers that treated negative numbers as self-contained entities. So, -2 was treated as the number -2, rather than the number 2 to which a unary minus is applied. It sounds like you are denying the reality of negative numbers... If (-) is going to be a distinct key from -, maybe it should only be allowed to be applied to numbers, so (-) X is not allowed, but (-) 1 is. But also allow -X or -1 with the usual lower precedence. It would be OK if they are displayed differently.. Alternatively, get rid of the (-) key.. just use -. Sharp pocket computers do this. The ones that have a calculator mode disable the (-) key when they are in BASIC mode. BTW, -2^2 gives 4 in Excel, but -4 in Matlab. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)