mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-04 12:56:45 +00:00
Fix failing tests from ruff/newton_raphson (ignore S307 "possibly insecure function") (#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>
This commit is contained in:
parent
a0eec90466
commit
44b1bcc7c7
@ -25,9 +25,11 @@ def newton_raphson(
|
|||||||
"""
|
"""
|
||||||
x = a
|
x = a
|
||||||
while True:
|
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
|
# This number dictates the accuracy of the answer
|
||||||
if abs(eval(func)) < precision:
|
if abs(eval(func)) < precision: # noqa: S307
|
||||||
return float(x)
|
return float(x)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user