In the 0-2^2, the answer is -4.
See: **broken link removed**
There is a difference between a negative number and subtraction.
-2^3 is a negative number raised to the 3rd powe.
0-2^2 is 2 raised to the second power subtracted from 0 because 04 is meaningless. "0" concatenated to -2^2 or "4". There is no operator between the elements.
If you ever see the expression -3^2 evaluated as 9, that's incorrect.
The exponentiation is always done before the negation unless there are
parentheses there to indicate otherwise.
However, there are some contexts in which it _looks_ like texts are
saying that -3^2 = 9, but a closer inspection will either reveal a
subtle interpretation or a misunderstanding. For instance, what is the
difference between the following statements:
"If I take negative three and square it, I get nine."
"If I square negative three, I get nine."
"If I evaluate negative three squared, I get negative nine."
"If I take the opposite of three squared, I get negative nine."
All of the above statements are correct. The reason some of them
end up with 9 as the answer and some end up with -9 is that some of
the statements have groupings implied in their phrasing. The first
two statements translate into algebraic notation as (-3)^2 = 9, the
third statement translates to -3^2 = -9, and the fourth statement
translates to -(3^2) = -9.
I'm hoping that's enough to convince you
If quoting a post from an internet forum is enough to convince you, I can get you to believe in Bigfoot.
OK...PEMDAS -
40 + 40 x 0 + 1 =
Since there are no parenthesis or exponents to deal with, we deal with the multiplication first -
40 x 0 = 0
which nulls out two numbers and leaves us with 40 + 1, which equals 41.
Now...if the equation were -
(40 + 40) x (0 + 1)
The answer would be 80 -
40 + 40 = 80
0 + 1 = 1
80 x 1 = 80
If the equation were -
(40 + 40) x 0 + 1 =
We would get -
40 + 40 = 80
80 x 0 = 0
0 + 1 = 1
Make sense?
At least I found something to support my position, which is more than I can say for you. I'd like to see you come up with something saying that the unary negative comes first when raising a value to a power.
Challenge accepted.
https://en.wikipedia.org/wiki/Unary_operator
"As unary operations have only one operand they are evaluated before other operations containing them."
Here are the variences explained:
http://zonalandeducation.com/mmts/expressions/raiseToAPower.html
I seem to remember finding this "bug" in Excel many years ago and argued it the right way. This time I checked in Excel, hoping they would have gotten it right, but it from Microsoft and that should have raised a flag. I ended up chasing my tail for checking first using the wrong reference.
BIG OOPS.
PS: I did tell you that I use parenthesis: such as (-1)^3
Time for some cookies?
Here is a harder one to understand:
-4^2
Now, the negative sign out front must wait till the raise to a power operation is finished. So, four raised to the second power is sixteen, since four times four is sixteen. After that evaluation the negative sign accepts the value of sixteen as an operand and produces a value of negative sixteen. Therefore, we can write:
-16 = -4^2
Find a quote from a professional mathematician that says the negation must come first and I will stand down.
That Wikipedia page references Matt Insall, who is an Associate Professor of Mathematics at Missouri University of Science and Technology.
What, you think I'm going to call Matt on the phone?
*ring* *ring* "Hello?"
"Hi, Matt, we were just having an argument on the internet, and I was wondering..."
Anyway, I would say my reference is still better than yours. You got a guy calling himself "Doctor Math" on an internet forum. From this page: http://mathforum.org/dr.math/abt.drmath.html it says: "By the year 2000, there had been over 300 volunteer 'Doctors' from all corners of the globe". Notice 'doctors' is in quotes. In other words, this is just a bunch of blowhards in a forum. Like us.
I give up: **broken link removed**
This one gives a specific rank to the operators and Unary - and + come first.
Time to find a "real book"
Here is the same argument were're having:
https://www.excelbanter.com/showthread.php?t=95534
With almost the same result. The order is as defined. Their feeling is that -1^3 is "ambiguous" and should be treated as such. Use parenthesis.
No wonder why the Russian's can't launch a rocket?
So, -1^3 has at least two answers that are correct.
If you said -1^3 in C, Matematica, Java, Excel, VB evaluates to (insert -1 or 1 here), only then can you have the correct answer.
I'm tired.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?