Skip to content

Conversation

@vil02
Copy link
Member

@vil02vil02 commented Mar 7, 2024

Open in Gitpodknow more

Describe your change:

findRoot errors when one is trying to find a root for x^3 on the interval [-1, 1]. This PR fixes that and adds a test cave case covering:

  • 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 JavaScript files are placed inside an existing directory.
  • All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames.
    Example:UserProfile.js is allowed but userprofile.js,Userprofile.js,user-Profile.js,userProfile.js are not
  • All new algorithms have a URL in their comments that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@vil02vil02 marked this pull request as ready for review March 7, 2024 22:15
@codecov-commenter
Copy link

codecov-commenter commented Mar 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.09%. Comparing base (bd34e9f) to head (f2f10bd).

Additional details and impacted files
@@ Coverage Diff @@## master #1640 +/- ## ========================================== + Coverage 84.07% 84.09% +0.02%  ========================================== Files 375 375 Lines 19688 19687 -1 Branches 2913 2914 +1 ========================================== + Hits 16552 16556 +4 + Misses 3136 3131 -5 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vil02vil02force-pushed the fix_bisection_method branch from d4baaca to ab6ffc9CompareMarch 17, 2024 18:33
@vil02vil02force-pushed the fix_bisection_method branch from ab6ffc9 to f2f10bdCompareMarch 17, 2024 18:39
raklaptudirm
raklaptudirm previously approved these changes Mar 18, 2024
@vil02vil02 changed the title fix: hadnle zeros at the endpointsfix: hadnle zeros at the endpoints BisectionMethodMar 18, 2024
@vil02vil02 changed the title fix: hadnle zeros at the endpoints BisectionMethodfix: hadnle zeros at the endpoints in BisectionMethodMar 18, 2024
appgurueu
appgurueu previously approved these changes Mar 26, 2024
Copy link
Collaborator

@appgurueuappgurueu left a comment

Choose a reason for hiding this comment

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

Math.pow(x, n) can be written as x**n btw, so you could simply write x => x ** 2 for example.

@vil02vil02 dismissed stale reviews from appgurueu and raklaptudirm via c7cda09March 26, 2024 22:07
@raklaptudirmraklaptudirm merged commit 34a663a into TheAlgorithms:masterApr 3, 2024
@vil02vil02 deleted the fix_bisection_method branch April 3, 2024 16:36
Sign up for freeto 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

@vil02@codecov-commenter@appgurueu@raklaptudirm