I'm programming a math expression parser for a class and I have a question, I'm getting conflicting answers

>writing a parser
>in python
1. Never write anything in python.
2. Never write a parser for things that the language already handles just fine.

In prefix or postfix notation, those parentheses are superfluous. In prefix notation, and assuming a unary `-` the two possible interpretations of -3^2 are:

- ^ 3 2

^ - 3 2

Look at old HP calculators...
It's a lost art, I'm afraid.
I think the only advantage of infix is that the operator is close to the operands.
But it only works for binary (2 args, not 1,0) operators.

"I'm not a robot" lol

You must not have read my post. When I write, I make it clear that it's 9, not -9. I didn't say anything about the post.

If you wanted to write 2^3-1^2, you really wouldn't want to be doing 2^3-(3^2) all the time. To simplify equations, append "0+" to the beginning of every expression to differentiate.

1. It's probably a HW assignment.
2. You're retarded

Are you fucking retarded?

It's (-3) ^ 2

What if it was (-3)^3, your second answer wouldn't make any sense

when I made my compiler, unary minus was given precedence over all other operations.

-(3^3) is equal to (-3)^3, though.

Every instance of binary - can be replaced by binary + with unary -
GJ