jiggzson / nerdamer

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

Fix invalid diff. squares factoring of polynomials #574

Closed ElectrifyPro closed 3 years ago

ElectrifyPro commented 3 years ago

Nerdamer incorrectly determines that a polynomial like x^2+y^2 could be factored with difference of squares; by implementing a check for the signs of the terms, this problem no longer happens

This should close #563

jiggzson commented 3 years ago

@ElectrifyPro, thank you for this PR. I was unable to close it because it had two failing tests. This solution correctly identified the problem but fixed it too far along. It was very helpful in providing the fix. Thanks again.