Skip to content

Commit aa3e48f

Browse files
CaedenPHpre-commit-ci[bot]
authored andcommitted
Fix failing tests from ruff/newton_raphson (ignore S307 "possibly insecure 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>
1 parent 7cb9ce1 commit aa3e48f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arithmetic_analysis/newton_raphson.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ def newton_raphson(
2525
"""
2626
x = a
2727
while True:
28-
x = Decimal(x) - (Decimal(eval(func)) / Decimal(eval(str(diff(func)))))
28+
x = Decimal(x) - (
29+
Decimal(eval(func)) / Decimal(eval(str(diff(func)))) # noqa: S307
30+
)
2931
# This number dictates the accuracy of the answer
30-
if abs(eval(func)) < precision:
32+
if abs(eval(func)) < precision: # noqa: S307
3133
return float(x)
3234

3335

0 commit comments

Comments
 (0)