rStats.js v1.3.0
    Preparing search index...

    Function lgamma

    • Natural logarithm of the absolute value of the gamma function, log|Gamma(x)|. Equivalent to R's lgamma(). Takes a single number.

      Near the zeros x = 1 and x = 2 the result keeps full relative accuracy (computed as lgamma(1 + e) = lgamma1p(e) and lgamma(2 + e) = lgamma1p(e) + log1p(e)).

      Parameters

      • x: number

        Argument.

      Returns number

      log|Gamma(x)|.

      lgamma(100);   // 359.1342053695754
      lgamma(-0.5); // 1.2655121234846454