Re: Inconsistent formulas



On Jan 5, 5:03 am, Jerry W. Lewis <post_a_reply@xxxxxxxxxxxxx> wrote:
If you look at a broader range of mathematical literature and computer
languages, I think you will find this to be very unusual operator precedence.
Unless you consider complex numbers, (-x)^y is not defined if y is not an
integer, and the '-' accomplishes nothing if y is even.  That may be part of
the thinking behind the more common precedence (not followed by Excel)
where unary minus has lower priority than exponentiation.

I have looked at a lot of mathematical literature in my lifetime, and
I do not recall any that uses "^" for exponentiation. In fact, "^" is
not even used universally in programming languages to mean
exponentiation. Of course, "^" means bitwise XOR in C and its
derivatives; it means "pointer to" in Pascal. In the first IBM
Mathematical FORmula TRANSlating System (FORTRAN), "**" is used for
exponentiation. In the original Dartmouth BASIC, an up-arrow was used
for exponential. (Up-arrow was actually a key -- shift-N -- on ASR-33
teletypes, which did not have "^".)

(Admittedly, I am not familiar with specifically mathematical
programming languages and libraries and their associated
documentation, which might be what Jerry intended to refer to.)

In mathematics, exponentiation is represented by a superscripted
expression. Of course, superscripting disambiguates the meaning of -x
(superscript) y because of the convention in mathematics of applying
the superscripted expression to the constant or variable immediately
to the left. And I am sure that __that__ is the "thinking behind"
giving exponentiation higher precedence than unary minus in those
programming languages that do and that use "^" (or up-arrow),
presumably being interpreted as "superscript".

Arguably, another possible explanation is that -x^y is mathematically
equivalent to 0 - x^y. In that case, "^" almost universally has
higher precedence over the binary "-", at least in programming
languages that have precedence. But that reasoning would not readily
lead to a reasonable interpretation of x^-y. On the contrary, using
similar reasoning, that would have to be explained as x^(0 - y); and
by extension, -x^y might then be explained as (0 - x)^y, which leads
to the Excel interpretation. Klunk! Ergo, advocates of -(x^y) as the
only "right" interpretation would do well to stick with the first
(hieroglyphical) explanation above.

FYI, in Dartmouth BASIC, x^y^z (using "^" here to mean up-arrow) was
interpreted as (x^y)^z, just as it is in Excel. (This comment is
really in reference to a comment that Dana DeLouis made.)
Interestingly, in Dartmouth BASIC, exponentiation was defined for only
non-negative values. What I really mean is: x^y was defined to mean
abs(x)^y. I'm sure the reason has more to do with the ease of
implementation of the BASIC interpreter than with any mathematical
principle ;-).
.



Relevant Pages

  • Re: Why an inconsistent ZF may be desirable, and should be welcome.
    ... > under their intuitive interpretation. ... > the foundations of mathematics, ... > mathematical languages of effective, and unambiguous, communication. ... recursive functions having the same representation. ...
    (sci.logic)
  • Re: The power difference between a macro and a function
    ... To put it another way, "understanding precedence" isn't the goal or a good thing, it is a cost/overhead/a bad thing. ... Another group of people reject the notion of prefix or postfix languages without having tried them, out of a gut feeling to stick with what they are used to. ... Of course, there are also people who tried both and indeed choose infix languages, but others make the switch. ... mathematics to remove ambiguity but we don't because we know the expressions are much more comprehensible when written in conventional style. ...
    (comp.lang.lisp)
  • PLMMS 2009: First Call for Paper
    ... The ACM SIGSAM 2009 International Workshop on Programming Languages ... for Mechanized Mathematics Systems will be co-located with TPHOLs 2009. ... Final Papers Due: July 10, ...
    (comp.lang.lisp)
  • PLMMS 2009: First Call for Paper
    ... The ACM SIGSAM 2009 International Workshop on Programming Languages ... for Mechanized Mathematics Systems will be co-located with TPHOLs 2009. ... Final Papers Due: July 10, ...
    (sci.math.symbolic)
  • Re: Oh Boy...More Brower Weirdness!!!
    ... Javascript is a "functional" programming language, which means that functions are first-class entities: they can be created and manipulated in various ways while the program runs. ... But even non-functional languages usually offer support for variables that refer to functions and can be used to evaluate functions. ... Treating code as data goes back to Goedel, Turing, and Church, all of whom developed mathematics that could manipulate mathematical expressions. ...
    (comp.lang.javascript)