You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comparing v2.2.6 with v2.3.2, there is a change in the behavior of Eval(int& stackSize) which is most likely a bug. When the expression has only a single return value, Eval(int& stackSize) always returns 0. The following code demonstrates this issue
#include<iostream>
#include<string>
#include"muParser.h"intmain(){
double p1, p2;
int nc1, nc2;
mu::Parser parser1;
parser1.DefineVar("X", &p1);
parser1.SetExpr("10.0");
mu::Parser parser2;
parser2.DefineVar("X", &p2);
parser2.SetExpr("X + 2");
std::cout << "\nParser1: Expected to be 10\n";
p1 = 1.0;
auto val1 = parser1.Eval(nc1);
for (unsigned ii = 0; ii < nc1; ++ii) {
std::cout << ii << "-th component:" << val1[ii] << std::endl;
}
std::cout << "\nParser2: Expected to be 12\n";
p2 = 10;
auto val2 = parser2.Eval(nc2);
for (unsigned ii = 0; ii < nc2; ++ii) {
std::cout << ii << "-th component:" << val2[ii] << std::endl;
}
return0;
}
The text was updated successfully, but these errors were encountered:
Comparing v2.2.6 with v2.3.2, there is a change in the behavior of Eval(int& stackSize) which is most likely a bug. When the expression has only a single return value, Eval(int& stackSize) always returns 0. The following code demonstrates this issue
The text was updated successfully, but these errors were encountered: