Contact

GAMMALN Function (Gnumeric)

Math Beginner Gnumeric

Use Gnumeric GAMMALN for log-gamma and factorial work, with native examples and its product-specific accepted negative noninteger intervals.

Verification status: 16 reference, boundary and explicit advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Retained native records and independent calculations were checked. Version 1.12.62 was source-checked only. How formula examples are checked

Quick answer: =GAMMALN(2) gives 0 in the tested Gnumeric 1.12.57 build.

Availability and version history

  • Introduced: First release not established.
  • Supported in: Gnumeric 1.12.62, with no retirement established.
  • Scope: Desktop Gnumeric with the Mathematics plugin; English comma-separated formulas are shown.
  • Checked: October 14, 2026. Reference and boundary tables plus the explicit advanced-check formula were recalculated through 1.12.57 ssconvert. Current 1.12.62 source was inspected; that later release was not executed.

What GAMMALN returns

GAMMALN returns the natural logarithm of the gamma function where this implementation accepts a real result. For positive integers n, GAMMALN(n)=LN((n−1)!). It is not GAMMA(LN(x)) and not a base-10 logarithm. Versioned function help.

Syntax and arguments

=GAMMALN(x)

Exactly one numeric argument is required. Positive x is the ordinary domain. Unlike positive-only contracts in some other products, Gnumeric also accepts selected negative noninteger intervals where Γ(x) is positive. Negative integers and intervals where Γ(x) is negative are rejected. Function implementation.

Reproducible examples

Ordinary results are rounded to twelve decimal places; tiny nonzero values use scientific notation. The eight reference rows were independently checked.

Formula Gnumeric 1.12.57 result
=GAMMALN(1) 0
=GAMMALN(2) 0
=GAMMALN(3) 0.69314718056
=GAMMALN(5) 3.178053830348
=GAMMALN(0.5) 0.572364942925
=GAMMALN(1.5) -0.120782237635
=GAMMALN(10) 12.801827480081
=GAMMALN(-1.5) 0.860047015376

Practical worksheet

=GAMMALN(5) gives approximately 3.178053830348, which is LN(24), the logarithm of 4!. For n! rather than (n−1)!, use =GAMMALN(n+1) with a nonnegative integer n. Make that shift explicit in a worksheet’s labels.

Log-domain calculation can avoid an overflowing factorial intermediate. Independently, GAMMALN(200) is approximately 857.933669825857, even though 199! exceeds ordinary binary64 range. That extra example is mathematical/source guidance, not one of this guide’s native table cases. Exponentiating the log immediately would recreate the original range problem.

Advanced interpretation and checks

The recurrence lnΓ(x+1)−lnΓ(x)=ln(x) gives a useful positive-domain check. The executed residual =GAMMALN(6)-GAMMALN(5)-LN(5) was approximately −2.220446049250E-16. That small residual illustrates ordinary rounding rather than failure of the identity.

A log-gamma result can itself be negative. GAMMALN(1.5) is approximately −0.120782237635 because Γ(1.5) lies between 0 and 1. A negative output is therefore not evidence that the input was outside the accepted domain.

Boundaries and troubleshooting

The native =GAMMALN(-1.5) returned approximately 0.860047015376, and =GAMMALN(-3.5) returned approximately −1.309006684993. In those intervals Γ(x)>0. By contrast, −0.5 and −2.5 produced #NUM!. Gnumeric’s explicit sign/interval guard explains this distinction.

Do not reinterpret the function as LN(ABS(GAMMA(x))) on the entire negative axis; that would assign results where this function rejects the input. Zero also produced #NUM!. Near poles, tiny input differences can create large changes, and subtracting nearly equal large log-gamma values can lose significant digits.

F5 below is an actually empty cell. The listed errors are native error results, not mathematical zeroes.

Formula Gnumeric 1.12.57 result
=GAMMALN(0) #NUM!
=GAMMALN(-0.5) #NUM!
=GAMMALN(-1) #NUM!
=GAMMALN(-2.5) #NUM!
=GAMMALN(-3.5) -1.309006684993
=GAMMALN("abc") #VALUE!
=GAMMALN(F5) #NUM!

Official evidence and checking scope

The retained workbook results include a deliberately stale SUM cache and an uncached SUM formula, both recalculated correctly. Native evidence covers the named 1.12.57 build and listed cases; cell-reference layouts and other explanatory compositions are instructions or independent mathematical checks unless explicitly identified as executed. Other locales, direct GUI entry and later-release output were not tested.