Contact

IMGAMMA Function in Gnumeric: Complex Gamma

Complex Intermediate Gnumeric

Calculate complex Gamma values in Gnumeric with factorial relationships, recurrence checks and pole cautions.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =IMGAMMA("0.5") evaluates the Gamma function, with expected value √π ≈ 1.772453851.

Availability and version history

  • Introduced: 1.12.10, according to the official release history.
  • Availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
  • Scope: Desktop; the fn-complex function module must be included and enabled.
  • Checked: October 14, 2026. Source and independently calculated examples checked; Gnumeric 1.12.62 was not run.

What IMGAMMA does

IMGAMMA evaluates the complete Gamma function Γ(z), including complex arguments. For positive integers n, Γ(n)=(n−1)!, so IMGAMMA(4) corresponds mathematically to 3!, not 4!. Use IMFACT for z! and IMIGAMMA for incomplete or regularized Gamma calculations. Function reference.

Syntax and inputs

=IMGAMMA(z)

z is one required complex number: a quoted complex string, a cell holding one, or the result of COMPLEX(real,imaginary). There is no second argument or default value. For example:

=IMGAMMA("1+2i")
=IMGAMMA(COMPLEX(1,2))
=IMGAMMA(A2)

Quote a literal such as "1+2i"; do not enter a bare 1+2i expression. COMPLEX accepts an optional i/j suffix. The examples use comma separators inside multi-argument functions; local formula conventions can differ.

Worked examples

Put the indicated complex text in A2:A9, without the outer quotation marks; prefix an apostrophe if needed to preserve text. Enter =IMGAMMA(A2) in B2 and fill down. The table gives mathematical reference values rounded to nine decimal places.

Complex input (as formula literal) Corresponding Gnumeric formula Expected mathematical result (approximately)
A2: "0.5" =IMGAMMA(A2) 1.772453851
A3: "1" =IMGAMMA(A3) 1.000000000
A4: "2" =IMGAMMA(A4) 1.000000000
A5: "3" =IMGAMMA(A5) 2.000000000
A6: "4" =IMGAMMA(A6) 6.000000000
A7: "-0.5" =IMGAMMA(A7) -3.544907702
A8: "1+i" =IMGAMMA(A8) 0.498015668 − 0.154949828i
A9: "1-i" =IMGAMMA(A9) 0.498015668 + 0.154949828i

Use =IMREAL(B2) and =IMAGINARY(B2) to compare coefficients. A different i/j suffix or display precision does not by itself change the complex value.

Example: fractional and complex Gamma values

For a fractional parameter of 0.5, =IMGAMMA("0.5") has expected value √π ≈ 1.772453851. For 3, the expected value is 2. These checks are useful when a model contains a Gamma normalization constant; they do not by themselves validate the probability model.

For z=1+i the expected Gamma value is approximately 0.498015668-0.154949828i. To check the recurrence Γ(z+1)=zΓ(z), store 1+i in A2 and use:

=IMGAMMA(IMSUM(A2,"1"))
=IMPRODUCT(A2,IMGAMMA(A2))

Put these formulas in C2 and D2, then calculate =IMABS(IMSUB(C2,D2)) in E2. The two complex values should be close. Near poles or with very large arguments, cancellation and overflow make a small example an inadequate accuracy check.

Γ(z) has poles at 0, −1, −2, and so on. If the required quantity is z!, use IMFACT. If the model needs an incomplete Gamma ratio, IMIGAMMA has a different argument contract, including lower/regularize options.

Input errors and practical checks

The 1.12.62 complex parser maps malformed complex text to #NUM!, whereas the web manual’s generic invalid-input note says #VALUE!. The pinned parser rejects other unsupported types with #VALUE!; coercion before that helper can affect blanks or Booleans. Use an explicit complex string or COMPLEX result when diagnosing an input problem.

Invalid numerical outputs are mapped to a numeric error by the release implementation. Avoid evaluating at the mathematical poles described above; an error token is not a substitute for checking the model’s domain.

Official sources