Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Doc/library/math.rst
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,19 @@
Return the `Gamma function <https://en.wikipedia.org/wiki/Gamma_function>`_ at
*x*.

Example::

>>> math.gamma(5) # factorial(n-1) for integer n
24.0
>>> math.gamma(2.5) # fractional values
1.329340388179137
>>> math.gamma(-1.5) # negative inputs
2.363271801207354
>>> math.gamma(0) # pole at zero
Traceback (most recent call last):
...
ValueError: math domain error
.. versionadded:: 3.2

Check warning on line 816 in Doc/library/math.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

Block quote ends without a blank line; unexpected unindent. [docutils]


.. function:: lgamma(x)
Expand All @@ -809,6 +821,19 @@
Return the natural logarithm of the absolute value of the Gamma
function at *x*.

Example::

>>> math.lgamma(5) # log(factorial(4))
3.1780538303479458
>>> math.lgamma(10.5) # fractional values
13.458901694870227
>>> math.lgamma(-0.5) # negative inputs
1.2655121234846454
>>> math.lgamma(0) # pole at zero
Traceback (most recent call last):
...
ValueError: math domain error

.. versionadded:: 3.2


Expand Down
Loading