T.R | Title | User | Personal Name | Date | Lines |
---|
2007.1 | FORTRAN was right | EVMS::HALLYB | Fish have no concept of fire | Fri Oct 27 1995 09:13 | 4 |
| > (y^z) z
> equivalent to x or to (x^y) ?
The former.
|
2007.2 | the logic behind it | WIBBIN::NOYCE | EV5 issues 4 instructions per meter | Fri Oct 27 1995 11:19 | 3 |
| 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.3 | Looking for Law, not Truth | AD::DEVER | | Fri Oct 27 1995 11:58 | 8 |
| 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.4 | CRC should cite references for each section | EVMS::HALLYB | Fish have no concept of fire | Fri Oct 27 1995 13:10 | 9 |
| 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.5 | | AUSSIE::GARSON | achtentachtig kacheltjes | Sat Oct 28 1995 01:58 | 26 |
| 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).
|