Update arithmetic_analysis/newton_raphson.py

Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Rohan Anand 2023-07-16 12:52:15 +05:30 committed by GitHub
parent 4074513e9c
commit 588de45cf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ def newton_raphson(func: str, a: float, precision: float = 10**-10) -> float:
if abs(val) < precision:
return float(x)
x = x - (val / diff_val)
x -= val / diff_val
return float(x)