[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

2007.0. "Precedence of Exponentiation" by AD::DEVER () Fri Oct 27 1995 10:46

	Does exponentiation take precedence from right to left or from left
    to right?  In other words, is the expression
    
		      z
		     y	      
		    X

	   	   (y^z)	    z
    equivalent to x      or to (x^y) ?

	My guess is right to left.  I've found only two references, neither
    of them mathematically authoritative: both HP (HP-48) and Casio
    calculators use left to right precedence, and Fortran uses the opposite.

	Any reply would be appreciated, but, since I need to know by Monday
    evening, a quick reply would be helpful.  References would be
    particularly helpful.

    /Dan
T.RTitleUserPersonal
Name
DateLines
2007.1FORTRAN was rightEVMS::HALLYBFish have no concept of fireFri Oct 27 1995 12:134
>	   	    (y^z)	    z
>    equivalent to x      or to (x^y) ?
    
     The former.
2007.2the logic behind itWIBBIN::NOYCEEV5 issues 4 instructions per meterFri Oct 27 1995 14:193
Left-to right would have made a^b^c the same as a^(b*c), which
is considered pointless.  So that's why it's right-to-left, and
a^b^c = a^(b^c).
2007.3Looking for Law, not TruthAD::DEVERFri Oct 27 1995 14:588
To clarify a bit, I'm looking for a reference to use as an authority to prevent
a potential dispute.  Something along the lines of "The Annals of the
International Math Board," if there is such a thing.

I have found another reference: _CRC_Handbook_of_Mathematical_Sciences_.  Does
this carry a lot of weight?  (It agrees with right to left.)

/Dan
2007.4CRC should cite references for each sectionEVMS::HALLYBFish have no concept of fireFri Oct 27 1995 16:109
    Well, where's the authority that says multiplication has higher
    precedence than addition? Or that subtraction associates left-to-right?
    
    Hmm, a little PostScript and I could have a reference card wiht all
    sorts of official-looking endorsements. Will that do? :-)
    
      John
    
    
2007.5AUSSIE::GARSONachtentachtig kacheltjesSat Oct 28 1995 04:5826
    re .3
    
    I don't think there is an applicable ISO standard. Can you elaborate on
    the potential dispute and perhaps we can advise you on the most
    appropriate reference source or standard?
    
    By the way, precedence is not the same thing as associativity. It is the
    latter to which you are referring in .0.
    
    For the reasons stated in .2 the more sensible associativity for the
    exponentiation operator is right to left.
    
    However any programming language is entitled to define its operators to
    have whatever precedence and associativity is seen fit for that
    language and indeed programming languages do differ in this area.
    
    The calculators are presumably using the non-standard left-to-right
    associativity for reasons of technical limitations. A simplistic
    calculator would simply evaluate each operator in the order entered
    without regard to precedence or associativity. This minimises the need
    for intermediate storage. A more sophisticated calculator might define
    a limited number of precedences and be able to store that number of
    intermediate values. However implementing right-to-left associativity would
    potentially require an unlimited amount of intermediate storage. This
    is barely an issue on modern computers but could be an issue with a
    calculator (or at least not worth designing for).