jiggzson / nerdamer

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

Fix #504 --Update nerdamer.core.js #505

Closed MuhammadAbdelsalam closed 4 years ago

MuhammadAbdelsalam commented 4 years ago

Fix #504

I can't edit precedence because it supposed 4 actually, so I added overloadLeftAssoc to specific the LeftAssoc property in case operator overloaded and changed block " //create the option for the operator being overloaded" to be earlier while loop.

jiggzson commented 4 years ago

@MuhammadAbdelsalam, can you explain why the precedence has to be 4? When changing it back to 4, 10%4*8 not evaluates to 16 which is incorrect. The correct value is 10.

MuhammadAbdelsalam commented 4 years ago

Hi jiggzosn, I can't understand why test cases failed? test cases are valid and i tried in my local and it's true var x = nerdamer('10%4*8'); console.log(x.toString());