jiggzson / nerdamer

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

simplify() returns 1 on an expression that is clearly not equal to 1 #577

Closed CAG2Mark closed 3 years ago

CAG2Mark commented 4 years ago

I am trying to simplify the following expression:

-(-5*x - 9 + 2*y))

When I run the simplify() function with Nerdamer, nerdamer("simplify(-(-5*x - 9 + 2*y))").toString(); ... it outputs 1 for some reason, which is very clearly wrong!

Even when running it in its simplest form: nerdamer("simplify(5*x - 2*y + 9)").toString(); ... it still outputs 1.

Does anyone know why this is happening?