-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Builtin math: ^
operator is left-associative
#6280
Comments
Seems like a fun isolated bug to tackle for anyone interested. Thanks for filing! |
Hie @ridiculousfish, I am really interested. Issue is really interesting and as I am new here I will need a little help. I have built it and I am looking into tinyexpr.cpp but not sure about changes.. |
Easy fix. This is configurable in upstream TinyExpr and that author just likes the left-to-right because that's how spreadsheets do it. I think it will confuse people. Let's change it. |
If you want to give it a shot @asprazz, go ahead! Look at this code upstream: https://github.com/codeplea/tinyexpr/blob/ffb0d41b13e5f8d318db95feb071c220c134fe70/tinyexpr.c#L415 See it has a compile time option for |
@floam Thank you for clarification. I will be working on this now.. :) 💯 |
Hie @floam, Can you please look into my changes ? Hey @floam, Thank you for guiding me out. Btw I have created a PR (may be someone will) please review it whenever possible |
This issue was raised with the author a long time ago: |
The result of
math '3^0.5^2'
is currently:That mean,
^
operator is left-associative.I think this is a bug because exponentiation operators in many languages are right-associative.
version:
The text was updated successfully, but these errors were encountered: