Skip to content

Commit

Permalink
Fix failing tests from ruff/newton_raphson (ignore S307 "possibly ins…
Browse files Browse the repository at this point in the history
…ecure function") (TheAlgorithms#8862)

* chore: Fix failing tests (ignore S307 "possibly insecure function")

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: Move noqa back to right line

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
CaedenPH and pre-commit-ci[bot] authored Jul 11, 2023
1 parent a0eec90 commit 44b1bcc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arithmetic_analysis/newton_raphson.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ def newton_raphson(
"""
x = a
while True:
x = Decimal(x) - (Decimal(eval(func)) / Decimal(eval(str(diff(func)))))
x = Decimal(x) - (
Decimal(eval(func)) / Decimal(eval(str(diff(func)))) # noqa: S307
)
# This number dictates the accuracy of the answer
if abs(eval(func)) < precision:
if abs(eval(func)) < precision: # noqa: S307
return float(x)


Expand Down

0 comments on commit 44b1bcc

Please sign in to comment.