Skip to content

Commit 87df2cf

Browse files
committed
Now both left and right sides properly computing
-Problem was that was treating the reference as if it was a pointer instead of re-targeting
1 parent 7e5f7b8 commit 87df2cf

2 files changed

Lines changed: 55 additions & 81 deletions

File tree

ExprFormulaTester/ExprFormulaTester.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ int main()
249249
//IntFormTest = "5+10x";
250250
//std::cout << IntFormTest.ToString() << " = " << IntFormTest.EvalValues(IntValueDefinitions) << std::endl;
251251

252-
MediumDecFormula AltFormTest = "x*5+(5+4)";//= "x+5";//Successful for simple addition calculation without inner formula
252+
MediumDecFormula AltFormTest = "(x+1)^(5+4)";
253253
tsl::ordered_map<std::string, MediumDec> ValueDefinitions;
254254
ValueDefinitions.insert_or_assign("x", MediumDec::Two);
255255

@@ -258,10 +258,4 @@ int main()
258258
std::cout << " = " << AltFormTest.ToString() << std::endl;
259259
AltFormTest.EvaluateOperations();
260260
std::cout << " = " << AltFormTest.ToString() << std::endl;
261-
AltFormTest = "(x+1)^(5+4)";//3^9=19683
262-
std::cout << "(MediumDecFormula) " << AltFormTest.ToString() << std::endl;
263-
AltFormTest.ReplaceVariablesWithValues(ValueDefinitions);
264-
std::cout << " = " << AltFormTest.ToString() << std::endl;
265-
AltFormTest.EvaluateOperations();
266-
std::cout << " = " << AltFormTest.ToString() << std::endl;
267261
}

0 commit comments

Comments
 (0)