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

Wrong operator associativity or precedence #127

Closed
qraynaud opened this issue Jun 21, 2018 · 1 comment
Closed

Wrong operator associativity or precedence #127

qraynaud opened this issue Jun 21, 2018 · 1 comment

Comments

@qraynaud
Copy link

qraynaud commented Jun 21, 2018

  • I'm submitting a bug report

  • Library Version:
    1.4.1

  • Operating System:
    Linux (KUbuntu 14.10)

  • Node Version:
    10.4.1

  • NPM Version:
    6.1.0

  • JSPM OR Webpack AND Version
    Neither, I'm using my own build system

  • Browser:
    all

  • Language:
    all

  • Current and expected behavior:
    I don't know which one is wrong, but either / or * has the wrong associativity (they should have a left one). Or maybe * has precedence over / while they should have the same precedence!

Eg, 4/2*10 is equal to 20 since it is equivalent to (4/2)*10 but I get 0.2.

There is the same kind of error with 4-2+10 that should be equal to 12 but is reported as -8 by aurelia.

It took me a very long time to understand this was not a mistake on my side ^^.

Here is a gist reproducing this: https://gist.run/?id=86a169dd2dea36afc86745cbe781d4dd

  • What is the motivation / use case for changing the behavior?
    Mathematical expressions have a very strong operator precedence/associativity acceptance. Everyone was taught those during school. I think it would be a very bad design decision to think this is a design choice.

Plus I think this is a regression because the expression looking like this in my code worked for some time.

@qraynaud
Copy link
Author

I think this bug should have been in aurelia-binding instead.

I think this is likely bug aurelia/binding/issues/586.

I'm closing this myself!

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

1 participant