Skip to content

Commit 187e8cc

Browse files
authored
Small fix (TheAlgorithms#2498)
1 parent 8904af9 commit 187e8cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: 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)