We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6b1b81 commit c19cef7Copy full SHA for c19cef7
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