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

Create square_root_using_netwon_repson.py #1753

Closed
wants to merge 1 commit into from
Closed

Create square_root_using_netwon_repson.py #1753

wants to merge 1 commit into from

Conversation

lablnet
Copy link
Contributor

@lablnet lablnet commented Feb 16, 2020

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@@ -0,0 +1,19 @@
# Finding Square Roots Using Newton's(Newton–Raphson) Method
n = input("Enter a number to find square root: ")
Copy link
Member

@cclauss cclauss Feb 16, 2020

Choose a reason for hiding this comment

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

This line causes our automated testing to fail. See CONTRIBUTING.md and Travis_CI_tests_are_failing.md.

Please encapsulate your algorithm into a function that could be dropped into a larger program:
def sqrt_using_newton_raphson(n: float) -> float:

Please add a few doctests that compare the results with math.sqrt(). Your function should behave just like math.sqrt() including using the same exceptions and exceptions messages.

@onlinejudge95
Copy link
Collaborator

Also, the file name should be square_root_using_newton_raphson.py

@TheSuperNoob
Copy link
Contributor

It also looks like maths/square_root.py is using the exact same algorithm. Not sure what the policy for duplicate algorithms is here.

@cclauss
Copy link
Member

cclauss commented Feb 18, 2020

If this algorithm is exactly the same as an existing algorithm then this PR should be closed especially given https://travis-ci.com/TheAlgorithms/Python/builds/149131996#L820

@github-actions
Copy link

Stale pull request message

@lablnet lablnet closed this Apr 19, 2020
@lablnet lablnet deleted the patch-1 branch April 19, 2020 04:57
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

Successfully merging this pull request may close these issues.

4 participants