• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
My operator can beat up your operator.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: My operator can beat up your operator.
      • From: John W Baxter <email@hidden>
    • Re: My operator can beat up your operator.
      • From: email@hidden (Michael Sullivan)
    • Re: My operator can beat up your operator.
      • From: Emmanuel <email@hidden>
References: 
 >Re: Order of operations (was: Eigenvalues &/or eigenvectors, (From: "Dennis W. Manasco" <email@hidden>)

  • Prev by Date: Re: Order of operations (was: Eigenvalues &/or eigenvectors,
  • Next by Date: Re: SE2beta contextual Find feature request
  • Previous by thread: Re: Order of operations (was: Eigenvalues &/or eigenvectors,
  • Next by thread: Re: My operator can beat up your operator.
  • Index(es):
    • Date
    • Thread