# Math statement parsed weirdly

• 06-04-2005
jverkoey
Math statement parsed weirdly
Alright, so I was testing out my math parser with just a completely random statement, below:

3+3/3*2423-234/234/234-234*3-4+(4-2/4)-34

Now, when I type it in to my calculator and google, I get the same result: 1,689.49573

3 + ((3 / 3) * 2 423) - ((234 / 234) / 234) - (234 * 3) - 4 + (4 - (2 / 4)) - 34

However, I don't understand why the ((234 / 234) / 234) - (234 * 3) - 4 + (4 - (2 / 4)) part is in its own parenthesis. Order of operations states that operators are done in the order that they occur in, right?

So.....shouldn't it be
Code:

`3  +  (3/3*2423)  -    234/234/234  -  234*3  -  4  +  (4-2/4)  -34`
Maybe I'm just confused....my math parser gives the following postfix output:
Code:

```3.000000 3.000000 3.000000 DIV 2423.00000 MUL ADD 234.000000 234.000000 DIV 234.000000 DIV SUB 234.000000 3.000000 MUL SUB 4.000000 SUB 4.000000 2.000000 4.000000 DIV SUB -34.000000 ADD```
which gives me -30.5

-edit-
Or...wait....Ok, I just retyped it in to my calculator and am still getting the same answer, so there must be an error in my infix->postfix evaluator...*wanders off*
• 06-05-2005
Sang-drax