Skip to content

Commit e731514

Browse files
authored
Fix typo and function call in maths module (TheAlgorithms#13515)
1 parent 709c18e commit e731514

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

maths/factorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def factorial_recursive(n: int) -> int:
5656
raise ValueError("factorial() only accepts integral values")
5757
if n < 0:
5858
raise ValueError("factorial() not defined for negative values")
59-
return 1 if n in {0, 1} else n * factorial(n - 1)
59+
return 1 if n in {0, 1} else n * factorial_recursive(n - 1)
6060

6161

6262
if __name__ == "__main__":

maths/fibonacci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def fib_memoization(n: int) -> list[int]:
183183
"""
184184
if n < 0:
185185
raise ValueError("n is negative")
186-
# Cache must be outside recursuive function
186+
# Cache must be outside recursive function
187187
# other it will reset every time it calls itself.
188188
cache: dict[int, int] = {0: 0, 1: 1, 2: 1} # Prefilled cache
189189

0 commit comments

Comments
 (0)