Calculator - Complex Example


Fine, the algorithms look simple enough for simple examples, but what about when things get complicated?  We'll consider:

     ( 1 / (5 + 6) / 72 ) * (3 + 9 / (10 * 23 + 4) )

Operand Operator TempOperand TempOperator
(    
/    
(
+
)
/
)
1 *
5 (
6 +
72 /
3 (
9 *
10 +
23 )
4 )    

We first push all preceding ')' ...                  Next Page...

                                         Precedence Example...

                                         Simple Example...