Skip to content

Create Quadratic Equations(Complexes Numbers) #941

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

Merged
merged 2 commits into from
Aug 6, 2019

Conversation

AugustofCravo
Copy link
Contributor

Created function that solves quadratic equations treating the cases with complexes numbers. Giving an answer with the imaginary unit "i".

Created function that solves quadratic equations treating the cases with complexes numbers. Giving an answer with the imaginary unit "i".
for a*x*x + b*x + c.
Ex.: a = 1, b = 3, c = -4
Solution1 = 1 and Solution2 = -4
"""
Copy link
Member

@cclauss cclauss Jul 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Please consider adding these two doctests at the end of this function's docstring:

    >>> QuadraticEquation(a=1, b=3, c=-4)
    The equation solutions are:  1.0 and -4.0
    >>> QuadraticEquation(5, 6, 1)
    The equation solutions are:  -0.2  and  -1.0

Our automated testing can then run the first line and raise an error if the result does not match the second line.

@cclauss
Copy link
Member

cclauss commented Jul 10, 2019

@PatOnTheBack Instead of a 👍 could I please ask you to Review changes because that will give project maintainers more confidence that you has read through the actual changes and believe that those changes will improve the state of our project?

Anyone can review a GitHub pull request:

  1. Scroll up on this page and click on Files changed just above the initial commit message.
  2. Click on the green button Review changes
  3. Click on Comment or Approve or Request changes and type a short note.

Thanks for taking the time to go through these extra steps which should help project maintainers.

Copy link
Member

@poyea poyea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. Thank you for your pull request!🤩

@cclauss cclauss added the tests are failing Do not merge until tests pass label Jul 29, 2019
@cclauss
Copy link
Member

cclauss commented Jul 30, 2019

@AugustofCravo Can you please work on getting the tests to pass so that we can merge?

Since there was no response from the owner of this PR, I made this little change which I hope will solve the issue!
@harshildarji harshildarji merged commit 22d2453 into TheAlgorithms:master Aug 6, 2019
@@ -1,3 +1,4 @@
from __future__ import print_function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshildarji This repo no longer supports legacy Python so we should avoid adding those __future__ imports which are no longer relevant in Python 3. Adding them give the impression that we tested these scripts on legacy Python which we do not do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cclauss Looking at the failure logs, I thought this could solve the issue. My bad! I'll remove it and see if it still gives the error!
Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem may be that the filename contains spaces and uppercase characters so validate_filenames will fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cclauss Please review #1102. The main problem indeed was the filename as it was without proper .py extension. I have changed the filename as well as removed the from __future__ import print_function line from the code.

stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Create Quadratic Equations(Complexes Numbers)

Created function that solves quadratic equations treating the cases with complexes numbers. Giving an answer with the imaginary unit "i".

* Update Quadratic Equations(Complexes Numbers)

Since there was no response from the owner of this PR, I made this little change which I hope will solve the issue!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests are failing Do not merge until tests pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants