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

cherry-pick #7140: Fix ApproxRoot Infinite Looping #7199

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Aug 29, 2020

From: #7140
Thanks: @migueldingli1997 for the patch.
Closes: #7038


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Added a maximum number of iterations (100) to ApproxRoot
(and ApproxSqrt) to serve as a hard limit on the number of
iterations that the algorithm performs. If the answer converges
before the maximum iterations, it returns immediately. Otherwise,
if the answer never converges enough to satisfy the primary loop
condition, the looping stops after a hundred iterations.

Closes: #7038
@codecov
Copy link

codecov bot commented Aug 29, 2020

Codecov Report

❗ No coverage uploaded for pull request base (launchpad/backports@42c3c57). Click here to learn what that means.
The diff coverage is n/a.

@@                  Coverage Diff                   @@
##             launchpad/backports    #7199   +/-   ##
======================================================
  Coverage                       ?   51.51%           
======================================================
  Files                          ?      338           
  Lines                          ?    20594           
  Branches                       ?        0           
======================================================
  Hits                           ?    10609           
  Misses                         ?     9190           
  Partials                       ?      795           

Copy link
Contributor

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

ACK

@alessio alessio merged commit cb23ee2 into launchpad/backports Aug 31, 2020
@alessio alessio deleted the launchpad/cherry-pick-018915b1a833717c0e5cc90db66b9540c90ea37e branch March 14, 2021 01:49
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.

5 participants