Post Reply 
Unary minus precedence preference
07-23-2014, 02:05 PM
Post: #15
RE: Unary minus precedence preference
(07-23-2014 12:08 PM)Wes Loewer Wrote:  Well, there's always a^b^c. Some treat it as (a^b)^c (Casio & older TI calculators) while others use a^(b^c) (HP in Algebraic mode & newer TI calculators). This one doesn't have a standard mathematical equivalent since the ^ character is not used in math for exponentiation, but a^(b^c) more likely matches what the user intended since the rising superscript fonts are evaluated from the top down.

Yet there doesn't seem to be a big disagreement about this case. I found exponentiation to be right-associative everywhere I looked, so even though there is an ambiguity, the convention is clear and followed by almost everybody nowadays (perhaps a few years back it was different, but today everybody seems to agree).

-wes

(07-23-2014 12:08 PM)Wes Loewer Wrote:  [minor correction: The site http://macnauchtan.com/pub/precedence.html indicated that MS-Works did not behave the same as Excel, but when I tried versions 2.0 (DOS) and 4.5a (Win95) I found that they did behave like Excel.]

Excellent link! Well worth the read.
I like how the cases are cataloged as "safe for engineers" or not. For mathematicians and students this might be a just a nuisance, but for us engineers it can be dangerous (literally).

Claudio
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Unary minus precedence preference - Claudio L. - 07-23-2014 02:05 PM



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