UNPKG

mathjs

Version:

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif

47 lines (28 loc) 886 B
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> # Function lgamma Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers. ## Syntax ```js math.lgamma(n) ``` ### Parameters Parameter | Type | Description --------- | ---- | ----------- `n` | number &#124; Complex | A real or complex number ### Returns Type | Description ---- | ----------- number &#124; Complex | The log gamma of `n` ### Throws Type | Description ---- | ----------- ## Examples ```js math.lgamma(5) // returns 3.178053830347945 math.lgamma(0) // returns Infinity math.lgamma(-0.5) // returns NaN math.lgamma(math.i) // returns -0.6509231993018536 - 1.8724366472624294i ``` ## See also [gamma](gamma.md)