Skip to content

Commit c19cef7

Browse files
dhruvmanilastokhos
authored andcommitted
Small fix (TheAlgorithms#2498)
1 parent d6b1b81 commit c19cef7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arithmetic_analysis/newton_method.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def newton(
3636
try:
3737
next_guess = prev_guess - function(prev_guess) / derivative(prev_guess)
3838
except ZeroDivisionError:
39-
raise ZeroDivisionError("Could not find root")
39+
raise ZeroDivisionError("Could not find root") from None
4040
if abs(prev_guess - next_guess) < 10 ** -5:
4141
return next_guess
4242
prev_guess = next_guess

0 commit comments

Comments
 (0)