Mathematic Expression Processing
- Quite often we need to evaluate mathematic expressions
- 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
- 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.
- i123.4 represents imaginary
- 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,
+ (B / (C + 1.23))");
double Result = equation.Evaluate();
MathEq.h - Math equation header file.
TSingLst.h - Supporting file to provide singly
TStack.h - Supporting file to provide stack.