From bb02773bb768d7b46a0b0f71c0acc43eacb56a1b Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Sun, 27 Sep 2020 13:18:00 +0530 Subject: [PATCH] Small fix --- arithmetic_analysis/newton_method.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arithmetic_analysis/newton_method.py b/arithmetic_analysis/newton_method.py index 97d5d3d3e470..a9a94372671e 100644 --- a/arithmetic_analysis/newton_method.py +++ b/arithmetic_analysis/newton_method.py @@ -36,7 +36,7 @@ def newton( try: next_guess = prev_guess - function(prev_guess) / derivative(prev_guess) except ZeroDivisionError: - raise ZeroDivisionError("Could not find root") + raise ZeroDivisionError("Could not find root") from None if abs(prev_guess - next_guess) < 10 ** -5: return next_guess prev_guess = next_guess