This repository has been archived by the owner on May 23, 2019. It is now read-only.
algebra.js 0.2.1
Bug Fixes
Expression.simplify
was failing when the expression consisted only of unsimplified constants. Previously, it would only simplify down to two constants:
exp = new Expression("x").add(3); // x + 3
exp = exp.pow(2, false); // xx + 3x + 3x + 3 * 3
exp = exp.eval({x: 2}, false); // 2 * 2 + 3 * 2 + 3 * 2 + 3 * 3
exp = exp.simplify(); // 6 + 19
Now it simplifies down to the single constant:
exp = exp.simplify(); // 25