- Quite often we need to evaluate mathematic expressions during programming.
- Evaluating fixed and straightforward equations are simple to code using customized code.
- However, some equations are complex to code. Furthermore, we need to change our code whenever we are changing the equations. Humans are prone to mistakes when making such changes.
**CMathEquation**is provided here to simplify the task. It takes in the equation in the format we are used to. Internal codes translate the equation into computer algorithm to perform the calculation. Thus, the change of coding is minimal(by changing the equation) when the equations need to be replaced.- Features
**i123.4**represents imaginary number.**sin A**represents sine of A.**cos A**represents cosine of A.**tan A**represents tanget of A.

- Currently, the template accepts <complex> type as argument. This may be replaced later.
- Known bugs:
- need parentheses to correctly process multiplication and division priority.

- For example,

CMathEquation<complex> equation("A + (B / (C + 1.23))");

equation.SetVariable("A", 3.42);

equation.SetVariable("B", 5.78);

equation.SetVariable("C", 1.23);

double Result = equation.Evaluate();

- Source code

MathEq.h - Math equation header file.

TSingLst.h - Supporting file to provide singly linked-list.

TStack.h - Supporting file to provide stack.