-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Calculator - Human multiplication expressions #24655
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jjavierdguezas
I took a first fast look at the code. Found a small typo in all test method names.
Please fill the PR checklist. And it would be great if you can create a PR for our docs page later.
[DataRow("pipipie", "pi * pi * pi * e")] | ||
[DataRow("(1+1)(3+2)(1+1)(1+1)", "(1+1) * (3+2) * (1+1) * (1+1)")] | ||
[DataRow("(1+1) (3+2) (1+1)(1+1)", "(1+1) * (3+2) * (1+1) * (1+1)")] | ||
public void RightHumaMultiplicationExpressionTransformation(string typedString, string expectedQuery) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huma -> Human. (Same for the other checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved
- fix some typos - updated dev docs - added PR examples to tests - improve method naming style
Hi @htcfreek , if I didn't add new files, do I have to check the " |
No need to check this box. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for your contribution!
Co-authored-by: Stefan Markovic <[email protected]>
* fixes microsoft#20187 * handles PR reviews - fix some typos - updated dev docs - added PR examples to tests - improve method naming style * Fix typo Co-authored-by: Stefan Markovic <[email protected]> --------- Co-authored-by: José Javier Rodríguez Zas <[email protected]> Co-authored-by: Stefan Markovic <[email protected]>
Summary of the Pull Request
PR Checklist
Detailed Description of the Pull Request / Additional comments
I took into account the combination of numbers (
num
), constants (const
), functions (func
) and expressions in parentheses ((exp)
). The blank spaces between them were also considered. The solution is based onregex
es. Some combinations were not handled as they are not common (but some could be handled if necessary)const const
:pie = pi * e
const num
:pi3 = pi * 3
not handled because it is not commonconst func
:eln(100) = e * ln(100)
const (exp)
:pi(1+1) = pi * (1+1)
num const
:2pi = 2 * pi
num num
: not handlednum func
:2log10(100) = 2 * log10(100)
num (exp)
:2(3+4) = 2 * (3+4)
func const
:log10(100)pi = log10(100) * pi
not handled because it is not commonfunc num
:log10(100)3 = log10(100) * 3
not handled because it is not commonfunc func
:sin(pi)cos(pi) = sin(pi) * cos(pi)
func (exp)
:log10(100)(2+3) = log10(100) * (2+3)
(exp) const
:(1+2)pi = (1+2) * pi
not handled because it is not common(exp) num
:(1+2)4 = (1+2) * 4
not handled because it is not common(exp) func
:(1+1)cos(pi) = (1+1) * cos(pi)
(exp) (exp)
:(1+1)(2+2) = (1+1) * (2+2)
Validation Steps Performed