Expression conversion, calculator and more
2016-08-23
1 0 0
no vote
Other
Earn points
This is a Pascal / Delphi unit with functions to calculate an arithmetic expression using the suffix form (RPN).
Normally expressions are written in "infix" form, e.g (3+4)*5-6... This is the human-readable form.
But the suffix form is super-easy to calculate (no parentheses, no taking care of operator priorities as it's all explicit).
The code uses this approach, and an appropriate structure (stack) to work with math expressions.
Included are:
- conversion from infix form string to RPN array
- calculator of suffix expressions;
- conversion back to string, human-readable form by simulating the calculator;
- helper functions for all of those;
- bonus: solver for one number game
pascal
转换
计算器
更多
Related Source Codes
Simple graph by free pascal
0
0
no vote
Face recognition
0
0
no vote
Unsuccessful case of CAN communication with CoDeSy
0
0
no vote
Clean Calculator Beta
0
0
no vote
Computing Peng Robinson equation
0
0
no vote
No comment