We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8904af9 commit 187e8ccCopy full SHA for 187e8cc
arithmetic_analysis/newton_method.py
@@ -36,7 +36,7 @@ def newton(
36
try:
37
next_guess = prev_guess - function(prev_guess) / derivative(prev_guess)
38
except ZeroDivisionError:
39
- raise ZeroDivisionError("Could not find root")
+ raise ZeroDivisionError("Could not find root") from None
40
if abs(prev_guess - next_guess) < 10 ** -5:
41
return next_guess
42
prev_guess = next_guess
0 commit comments