Re: Order of operations (was: Eigenvalues &/or eigenvectors, anyone?)
Re: Order of operations (was: Eigenvalues &/or eigenvectors, anyone?)
- Subject: Re: Order of operations (was: Eigenvalues &/or eigenvectors, anyone?)
- From: Michael Kelly <email@hidden>
- Date: Thu, 8 May 2003 09:57:21 -0700
- Mail-followup-to: AppleScript-Users <email@hidden>
On Thu, May 08, 2003 at 09:25:44AM -0600, Doug McNutt wrote:
>
At 20:31 -0700 5/7/03, Michael Kelly wrote:
>
>Wow. I am both horrified and intrigued. Is there an actual reason for
>
>this, or did some bored Apple tech just decide to change the order of
>
>operations to mess with people's minds?
>
>
I did file a bug report and it made it up the chain far enough to get
>
a number. The problem is that some professor in some computer science
>
department decided there was something called a "unary minus" operator
>
which is not a subtraction. Back when algebra was taught in high
>
school - remember that? - we learned that a leading minus sign implied
>
a preceding zero.
This is interesting. It makes sense now that I think about it, but -2^2
= 4 is still completely unintuitive, and is just asking for problems.
Having to force it to be a subtraction operator, as Michelle mentioned,
by saying 0-2^2 (or just forcing the matter with parens), is ridiculous.
>
The only other language I know that has it "wrong" is Microbesoft
>
Excel where it's a unary minus if executed as a worksheet formula but
>
an algebraically correct subtraction if executed as a Visual Basic
>
macro. FORTRAN, BASIC, Gnumeric, AppleWorks, Maple, perl all have it
>
"right". C doesn't have a power operator.
And all that's involved in fixing it is just moving the precedence of
the unary - down below that of the exponentiation operator, ^. I know
it's normally not good practice to do things like change operator
precedence between releases, but isn't this something screaming to be
fixed?
In table 3-1, on p. 87 of Programming Perl, one will notice that the
unary - has precedence right below that of ** (as you stated Perl has it
right). How reassuring.
Not trying to be combative or anything -- just trying to vent some of my
frustration about AppleScript. It never ends. Make the hurting stop...
--
Michael
email@hidden
http://www.jedimike.net
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.