My operator can beat up your operator.
My operator can beat up your operator.
- Subject: My operator can beat up your operator.
- From: Christopher Nebel <email@hidden>
- Date: Mon, 12 May 2003 13:34:30 -0700
On Saturday, May 10, 2003, at 02:13 AM, Dennis W. Manasco wrote:
At 3:54 pm -0400 5/9/03, Michael Sullivan wrote:
It's ridiculous to have the minus have a higher precedence than the
power operator, because it just gets lost if the power is even.
I see nothing _ridiculous_ about producing an algebraically and
mathematically correct result.
Whether you find it intuitive, ridiculous, or otherwise, standard
algebraic practice is that exponentiation has higher precedence than
negation, so without parentheses, -3^2 comes out to -9, not 9.
AppleScript does *not* follow this rule: it considers negation to be a
separate operator with higher precedence than exponentiation, so -3^2
comes out to 9, not -9. Some other systems, notably Excel, do this.
There is a bug filed on this. It's unlikely to ever be fixed in
AppleScript 1.x because of backward compatibility concerns. However,
some future version that fixed other things that would break backward
compatibility might fix this one as well.
For further reading on the topic, see the alt.algebra.help FAQ at
<
http://home.earthlink.net/~aahfaq/node27.html>
--Chris Nebel
Apple Development Tools
_______________________________________________
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.