Skip to content

Commit

Permalink
Fix accuracy in maclaurin_series and RecursionError msg
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Oct 3, 2023
1 parent 430f9c5 commit d07a378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backtracking/combination_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions maths/maclaurin_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d07a378

Please sign in to comment.