Skip to content

Commit b72d068

Browse files
tianyizheng02github-actionsChrisO345
authored
Remove extra imports in gamma.py doctests (#8060)
* Refactor bottom-up function to be class method * Add type hints * Update convolve function namespace * Remove depreciated np.float * updating DIRECTORY.md * updating DIRECTORY.md * updating DIRECTORY.md * updating DIRECTORY.md * Renamed function for consistency * updating DIRECTORY.md * Remove extra imports in gamma.py doctests Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Chris O <[email protected]>
1 parent 90686e3 commit b72d068

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

Diff for: maths/gamma.py

-15
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,27 @@ def gamma(num: float) -> float:
1111
used extension of the factorial function to complex numbers.
1212
The gamma function is defined for all complex numbers except the non-positive
1313
integers
14-
15-
1614
>>> gamma(-1)
1715
Traceback (most recent call last):
1816
...
1917
ValueError: math domain error
20-
21-
22-
2318
>>> gamma(0)
2419
Traceback (most recent call last):
2520
...
2621
ValueError: math domain error
27-
28-
2922
>>> gamma(9)
3023
40320.0
31-
3224
>>> from math import gamma as math_gamma
3325
>>> all(.99999999 < gamma(i) / math_gamma(i) <= 1.000000001
3426
... for i in range(1, 50))
3527
True
36-
37-
38-
>>> from math import gamma as math_gamma
3928
>>> gamma(-1)/math_gamma(-1) <= 1.000000001
4029
Traceback (most recent call last):
4130
...
4231
ValueError: math domain error
43-
44-
45-
>>> from math import gamma as math_gamma
4632
>>> gamma(3.3) - math_gamma(3.3) <= 0.00000001
4733
True
4834
"""
49-
5035
if num <= 0:
5136
raise ValueError("math domain error")
5237

0 commit comments

Comments
 (0)