From d07a37837d128a91a2e7bf71a8060a22c0ee22f8 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 3 Oct 2023 10:37:39 +0200 Subject: [PATCH] Fix accuracy in maclaurin_series and RecursionError msg --- backtracking/combination_sum.py | 2 +- maths/maclaurin_series.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backtracking/combination_sum.py b/backtracking/combination_sum.py index f555adb751d0..3c6ed81f44f0 100644 --- a/backtracking/combination_sum.py +++ b/backtracking/combination_sum.py @@ -47,7 +47,7 @@ def combination_sum(candidates: list, target: int) -> list: >>> combination_sum([-8, 2.3, 0], 1) Traceback (most recent call last): ... - RecursionError: maximum recursion depth exceeded in comparison + RecursionError: maximum recursion depth exceeded """ path = [] # type: list[int] answer = [] # type: list[int] diff --git a/maths/maclaurin_series.py b/maths/maclaurin_series.py index e55839bc15ba..a56e9debfb14 100644 --- a/maths/maclaurin_series.py +++ b/maths/maclaurin_series.py @@ -17,7 +17,7 @@ def maclaurin_sin(theta: float, accuracy: int = 30) -> float: >>> all(isclose(maclaurin_sin(x, 50), sin(x)) for x in range(-25, 25)) True >>> maclaurin_sin(10) - -0.544021110889369 + -0.5440211108893691 >>> maclaurin_sin(-10) 0.5440211108893703 >>> maclaurin_sin(10, 15) @@ -69,7 +69,7 @@ def maclaurin_cos(theta: float, accuracy: int = 30) -> float: >>> all(isclose(maclaurin_cos(x, 50), cos(x)) for x in range(-25, 25)) True >>> maclaurin_cos(5) - 0.28366218546322675 + 0.2836621854632268 >>> maclaurin_cos(-5) 0.2836621854632266 >>> maclaurin_cos(10, 15)