Skip to main content
Module

x/simplestatistics/index.js>gammaln

simple statistics for node & browser javascript
Go to Latest
function gammaln
import { gammaln } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";

Compute the logarithm of the gamma function of a value using Lanczos' approximation. This function takes as input any real-value n greater than 0. This function is useful for values of n too large for the normal gamma function (n > 165). The code is based on Lanczo's Gamma approximation, defined here.

Examples

gammaln(500); // 2605.1158503617335 gammaln(2.4); // 0.21685932244884043

Parameters

n

Any real number greater than zero.