From 187e8ccc95f280d3a303613c2fc80fcf50081a23 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sun, 27 Sep 2020 18:35:09 +0530 Subject: [PATCH] Small fix (#2498) --- 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 97d5d3d3e..a9a943726 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