Skip to content

Comment on Ask HN: What is -2^2?

Comments

I believe the most common answer is -4, due to exponentiation having a higher precedence than negation. I'm not sure it's completely standard, though. In written mathematics it would be more common to write (-2)^2 if you really meant the -2 to be exponentiated. But, it might be different if you were using a style of traditional mathematics typesetting where unary negation and subtraction are more clearly distinguished. I could imagine something like 5 - -2^2 meaning to subtract (-2)^2 from 5, if it were written in a typesetting style where the unary minus was smaller and clearly more "bound" to the 2 than the subtraction was.

Miscellaneous support: a random elementary algebra textbook: http://infinity.cos.edu/algebra/Rueger%20Text/Chapter02/2.6_... and a dude from mathforum.org: http://mathforum.org/library/drmath/view/53240.html

That Math Forum post is excellent. Thanks!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.