Re: Order of operations (was: Eigenvalues &/or eigenvectors,
Re: Order of operations (was: Eigenvalues &/or eigenvectors,
- Subject: Re: Order of operations (was: Eigenvalues &/or eigenvectors,
- From: "Dennis W. Manasco" <email@hidden>
- Date: Sat, 10 May 2003 04:13:33 -0500
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.
x^2 is defined mathematically as (x) * (x)
x^3 is defined mathematically as (x) * (x) * (x)
x^4 is defined mathematically as (x) * (x) * (x) * (x)
x^5 is defined mathematically as (x) * (x) * (x) * (x) * (x)
3^2 = (3) * (3) = 9
3^3 = (3) * (3) * (3) = 27
3^4 = (3) * (3) * (3) * (3) = 81
3^5 = (3) * (3) * (3) * (3) * (3) = 243
-3^2 = (-3) * (-3) = 9
-3^3 = (-3) * (-3) * (-3) = -27
-3^4 = (-3) * (-3) * (-3) * (-3) = 81
-3^5 = (-3) * (-3) * (-3) * (-3) * (-3) = -243
I see nothing _ridiculous_ about producing an algebraically and
mathematically correct result. I would be very upset if the results I
received from a power function deviated from what I would calculate
with pencil and paper or a calculator.
It makes sense that unambiguously unary numbers, when raised to a
power, should have their sign applied before they are multiplied. To
do otherwise is to seriously deprecate the value of negative numbers;
at this point we should probably throw away the concept of zero as
well.
By the same token z = x - y^a had better evaluate to z = (x) -
((y)^(a)) or we are going to have some serious problems....
-=-Dennis
_______________________________________________
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.