jiggzson / nerdamer

a symbolic math expression evaluator for javascript
http://www.nerdamer.com
MIT License
517 stars 82 forks source link

Solving an equation with variable x works, but not with variable a (solveEquations) #525

Closed q2apro closed 4 years ago

q2apro commented 4 years ago

I tried to solve:

sol = nerdamer.solveEquations('2*a^(2)+4*a*6=128');
console.log(sol.toString());

which gives `""``. The same with:

 var sol = nerdamer('solve(2*a^(2)+4*a*6=128, a)');
 console.log(sol.toString());

What is the problem? The dev console does not throw an error.

But using x instead of a works:

nerdamer.solveEquations('2*x^(2)+4*x*6=128').toString();
nerdamer('solve(2*x^(2)+4*x*6=128, x)').toString()
jiggzson commented 4 years ago

@q2apro, fixed on the dev branch.