lgamma
.. lgamma(x)
Compute the logarithm of the absolute value of :func:`gamma` for
:obj:`Real` ``x``, while for :obj:`Complex` ``x`` it computes the
logarithm of ``gamma(x)``.
Examples
In the Julia programming language, the function lgamma(x)
Compute the logarithm of the absolute value of gamma
for a real number x
. For a complex number x
, it computes the logarithm of gamma(x)
.
julia> lgamma(3.5)
0.8728715609439694
julia> lgamma(1 + 2im)
-0.36643805392468204 - 1.1071487177940904im
Here are some common examples of its use:
-
Compute the logarithm of gamma for a real number:
julia> lgamma(2.5) 0.2846828704729192
It computes the logarithm of
gamma(2.5)
. - Compute the logarithm of gamma for a complex number:
julia> lgamma(1 + 2im) -0.36643805392468204 - 1.1071487177940904im
It computes the logarithm of
gamma(1 + 2im)
.
Please note that the lgamma
function behaves differently for real and complex numbers. For real numbers, it computes the logarithm of the absolute value of gamma(x)
, while for complex numbers, it computes the logarithm of gamma(x)
directly.
See Also
User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.