Update newton_raphson.py

This commit is contained in:
Rohan Anand 2023-07-16 20:57:10 +05:30 committed by GitHub
parent cc3d6a62fc
commit aeb42b1e12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,9 @@ def newton_raphson(
... ...
ValueError: precision must be greater than zero ValueError: precision must be greater than zero
""" """
if precision <= 0:
raise ValueError("precision must be greater than zero")
x = start_point x = start_point
symbol = symbols("x") symbol = symbols("x")