Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i need a small prog to calculate a MATH expression

Status
Not open for further replies.

InfoSeaker

Programmer
Dec 13, 2001
1
0
0
SA
hi guys,

i am working on an assembly project and what remains is the expression solver.

if anyone has something, plz let me know.

i can provide the helper with my final project work if he wishes

for more details , contact me on: a_explorer_2000@yahoo.com

regards,

 
ANY math expression?

I had an idea once on how to process a math expression although unfortunately it works only if all the operators are *left-to-right* associative. It involves using a stack; if the next operator is higher precedence, the current operator is pushed on the stack, and the next operator is taken; if the next operator is lower precedence, then the current operator is performed. If an open parenthesis is encountered, the expression evaluator calls itself and forms a new stack structure; if a close parenthesis is encountered the evaluator returns to the parent evaluator.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top