It is possible to have Z = E / (A +B / C) * D

One result is Z = (E / ((A + B) / C)) * D

If you did it the above way it would be incorrect. The use of parenthesis in this case would be

Z = (E / (A + (B/C))) *D

for this case the correct RPN for this would look something like

Z = E A B C

/ + / D

* E, A, B and C are pushed onto the stack

division of B by C is done by

/ into result

A is add to result is done by

+ into result

E divided by result is done by

/ into result

D pushed onto stack

E multiply by D is done by

* into result = Z

When converting to RPN the AOS precedence must be followed and where ambiguous the left to right rule is used, check this link:

https://en.wikipedia.org/wiki/Order_of_operations `1 () [] -> . :: Function call, scope, array/member access`

2 ! ~ - + * & sizeof type cast ++ -- (most) unary operators, sizeof and type casts (right to left)

3 * / % MOD Multiplication, division, modulo

4 + - Addition and subtraction

5 << >> Bitwise shift left and right

6 < <= > >= Comparisons: less-than and greater-than

7 == != Comparisons: equal and not equal

8 & Bitwise AND

9 ^ Bitwise exclusive OR (XOR)

10 | Bitwise inclusive (normal) OR

11 && Logical AND

12 || Logical OR

13 ? : Conditional expression (ternary)

14 = += -= *= /= %= &= |= ^= <<= >>= Assignment operators (right to left)

15 , Comma operator

Also Pelles C help file has a section on operator precedence search for "C operator precedence and order of evaluation"

John Z