Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's no "mistake", the current way makes much more sense in programming notation. It's far better that -3^2 is consistent with -3+2. The caret notation for exponentiation is anyway completely different, and works very differently in terms of precedence from using super scripts in math.


That's a mistake in every statement: Excel isn't programming, so programming notation isn't even relevant

There is also no difference in the caret notation vs superscript, its upward pointing form literally meant to signify SUPERscript

It's far better that

0-3^2

-3^2

are consistent, consistency between exponent and addition makes little sense since by universal convention they have different priorities, so you'd not expect any "consistency" there Also your -3+2 example is meaningless since its output is the same as

-((+3)+2)

so there is no inconsistency with

-9

And no, ^ doesn't universally work differently vs superscript, just in some poorly designed apps


Excel formulae are absolutely a form of computation, or programming.

While the caret is meant to symbolize superscript, it is nevertheless a completely different notation for exponentiation.

I don't see why 0-3^2 and -3^2 need to be consistent necessarily. Sign change and subtraction are different operations, so they can have different relationships with other operators.

If + worked like you want ^ to work, then -3+2 would equal -5, instead of the more common -1.

^ does work differently from superscript in all apps. The way you write "three to the power two plus two" is completely different.


Abacus is a form of computation, doesn't make it programming.

> While the caret is meant to symbolize superscript, it is nevertheless a completely different notation for exponentiation.

Wait, do you believe slash / to be a completely different notation with different rules for division?

Also, it's not completely different, I've already explained that its form points to the same participle - RAISing base to the power, exactly the same as superscript. It's just that input/typesetting on computers is very primitive, so you can't really use superscript conveniently, otherwise it's semantically the same, so having different rules for the same meaning makes no sense

> I don't see why 0-3^2 and -3^2 need to be consistent necessarily

ok, if you fail to see this basic similarity but somehow think -3+2 is identical, don't have anything else to say here

> If + worked like you want ^ to work, then -3+2 would equal -5, instead of the more common -1.

Why would I ever want addition to work the same as exponeiation??? That's your weird wish for them to behave the same, I respect the math precedence of operators.

> ^ doesw differently from superscript in all apps

that's not true, https://www.wolframalpha.com/input?i=-3%5E2

Many calculators / calculator apps also behave the same


In Wolfram alpha as well, ^ is a different notation than superscripts: https://www.wolframalpha.com/input?i=-3%5E2%2B2

And of course / is completely different from fractions too. Math notation is two-dimensional, and requires relatively few parentheses. Computer notation is uni-dimensional and requires parentheses all over the place.

This is how math notation looks like, try to write this in C/Excel/Wolfram Alpha without parens:

      2 + 2
    -3      + 4
   _____________ = 17
      2 + 3


> try to write this ... without parens:

Why? This extra condition doesn't help you, and why your link shows nothing, it behaves exactly as I'd expect, ^ is identical to superscript, you're just making an implicit mistake of thinking +2 is somehow covered by ^ and would be part of the superscript, but it wouldn't, that's a different source of ambiguity

What would help is an example where parens aren't needed, but nonetheless slash would mean something else vs horizontal line, like in the original example

That's how you show semantic "completely different"


The math notation doesn't need parens. The computer notation needs parens. This alone is simple obvious proof that they are different notations, at least in my understanding of what a notation is.


-3^2 in the math notation doesn't need parens only because of operator precedence.

The fact that the computer ^ requires parens in more cases like -3^(2+2) is irrelevant for this and doesn't allow you justifying different precedence rules (and your downgrading from "completely different" to "different" isn't a proof, just "tautology". Hey, they also look different, so they are different!)


I don't have a horse in this seemingly extremely important race, but Excel absolutely is programming




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: