-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Develop a parser for arbitrary expressions in the calc engine #526
Comments
This pitch looks like it has everything it needs for review. In the meantime, we'll keep this idea open for discussion so the community has the chance to provide feedback. Check out our New Feedback Process for more info on the user-centered process we follow for new feature development. |
This pitch looks like it has everything it needs for review. In the meantime, we'll keep this idea open for discussion so the community has the chance to provide feedback. Check out our New Feedback Process for more info on the user-centered process we follow for new feature development. |
This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it. |
For information, I already built an expression parser to improve the #344 (and proto-PR here: https://github.com/rudyhuyn/calculator/tree/AddExpressionParser) Don't hesitate to take a look |
If this will be implemented, I suggest making the mathematical operators customizable, as they are regional, cultural and personal preferences. |
We reviewed the pitch and would love to explore this idea further! The pitch is a great start, but there are still some open questions. I am moving this issue into planning to iron out some of those details and I created calculator-specs/expressionParser to track progress. A human will follow up with some feedback on your pitch shortly. Keep in mind that not all ideas that make it into the planning phase are guaranteed to make it to release. For more information on next steps, check out our spec workflow. |
Overall, this seems like a great improvement! A couple comments/questions:
@leduyquang753 I am not sure I understand your example; can you clarify? I agree we should support any standard input methods, but I don't think it makes sense to support custom operator input assignment. |
I agree, custom operators will require a lot more work (including a dialog to modify them) and can create many issues with shortcuts or when new features will be added to the Calculator. @leduyquang753 If it's the case, I agree with that, all official symbols should be supported, it's the case of the proto I wrote some months ago. Of course, except when they create a conflict. The goal should be to allow a user to copy & paste a formula from a website, whatever the language of the website and make it work without any modification. For example: Multiplication:
Division:
|
Actually Vietnam uses the period to indicate multiplication (officially used in education, textbook images can be included if needed). In order not to create conflicts (if the decimal separator is already period), a check can be easily implemented. |
Like to state, PowerToys would very much like this :) |
is there a list of expressions this will support? Example: bin2dec or arcsin |
so like is anything happening with this? |
Problem Statement
Currently, Calculator executes all operations in immediate mode--press an operator, get a new answer. For multiple scenarios, it would be useful for the user to enter an expression like "(5 + 2) * 3" and have Calculator parse and compute the result.
Evidence or User Insights
Several proposed features could leverage this work:
Proposal
Add code and tests to the calc engine to parse mathematical expressions as strings.
Goals
Non-Goals
Requested Assignment
I'm happy to help with this, but would be great for someone else to implement.
The text was updated successfully, but these errors were encountered: