I found numerous examples on converting infix expression to postfix expression but my program needs to include some functions like sqrt(x), min/max(x,y), fact(x), abs(x).

abs(‐5) is converted to ‐5 abs
120 – (45+3) is converted to 120 45 3 + ‐
(3^2 + 4^5)*fact(3) is converted to 3 2 ^ 4 5 ^ + 3 fact *
min(3‐(4‐7) , (2+4)/3) is converted to 3 4 7 ‐ ‐ 2 4 + 3 / min

Thanks for your input!

Recommended Answers

All 2 Replies

What I'm confused about what is the precedence of those functions needs to be.

See this..
Specifically this part:
* It is known a priori that the operator takes n arguments.
* If there are fewer than n values on the stack
** (Error) The user has not input sufficient values in the expression.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.