GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove extra imports in gamma.py doctests (#8060) · https-github-com-nzysoft/Python@b72d068

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • maths
    • gamma.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎maths/gamma.py‎

Copy file name to clipboardExpand all lines: maths/gamma.py
-15Lines changed: 0 additions & 15 deletions
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 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.