New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify error #998

Closed
hst-mdg opened this Issue Dec 26, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@hst-mdg

hst-mdg commented Dec 26, 2017

The following code

var t="-(x-y)";
var s=math.simplify(t);
console.log("t: "+t);
console.log("s: "+s.toString()); 

results in the output:

t: -(x-y)
s: -x

So something seems to be seriously wrong with the simplification rules?!
Or does simplify not work with multiple variables?!

(I am using https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.18.0/math.min.js)

@firepick1 firepick1 self-assigned this Dec 26, 2017

firepick1 added a commit that referenced this issue Dec 26, 2017

@firepick1

This comment has been minimized.

Collaborator

firepick1 commented Dec 26, 2017

Thanks for finding this bug. It was a special case in unary minus that did not handle subtracted sub-expression. Jos, I submitted changelist with fix and new unit test. All tests pass in simplify2 branch.
f1d0beb

@firepick1

This comment has been minimized.

Collaborator

firepick1 commented Dec 26, 2017

Reverted package-lock.json change in 9365c73

@josdejong josdejong added the bug label Dec 28, 2017

@josdejong

This comment has been minimized.

Owner

josdejong commented Dec 28, 2017

👍 thanks for the quick fix @firepick1 . Will do a release tonight.

@josdejong

This comment has been minimized.

Owner

josdejong commented Dec 28, 2017

I've released v3.18.1 containing this fix.

@josdejong josdejong closed this Dec 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment