Skip to content
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

Multiplication and division by negative numbers is broken #77

Closed
pchiquet opened this issue Jun 9, 2023 · 0 comments
Closed

Multiplication and division by negative numbers is broken #77

pchiquet opened this issue Jun 9, 2023 · 0 comments

Comments

@pchiquet
Copy link

pchiquet commented Jun 9, 2023

Simple expressions such as 1/-1 or 1*-1 can not be evaluated.

  • It is a regression since a0f978c
  • PR with auto tests here Fix "changeSign" precedence for multiplication and division by negative numbers #76
    On master, the tests failed with Cannot read properties of undefined (reading 'value')
    Full log:
    1) Testing Unit dividing by negative number :
       TypeError: Cannot read properties of undefined (reading 'value')
        at t.w [as postfixEval] (C:\Users\pierr\git\contribs\web\math-expression-evaluator\dist\es\index.js:1:6463)
        at t.eval (C:\Users\pierr\git\contribs\web\math-expression-evaluator\dist\es\index.js:1:10931)
        at Context.<anonymous> (C:\Users\pierr\git\contribs\web\math-expression-evaluator\test\index.js:183:21)
        at callFn (C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runnable.js:326:21)
        at Test.Runnable.run (C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runnable.js:319:7)
        at Runner.runTest (C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runner.js:422:10)
        at C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runner.js:528:12
        at next (C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runner.js:342:14)
        at C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runner.js:352:7
        at next (C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runner.js:284:14)
        at Immediate._onImmediate (C:\Users\pierr\git\contribs\web\math-expression-evaluator\node_modules\mocha\lib\runner.js:320:5)
        at processImmediate (node:internal/timers:466:21)
    
pchiquet pushed a commit to pchiquet/math-expression-evaluator that referenced this issue Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants