Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was messing around with my TI-84 Plus Silver Edition calculator and discovered that it will actually give me values when taking the factorial of any number $n/2$ where $n$ is any integer greater than $-2$. Why does this happen? I thought factorials were only defined for positive integers and $0$, so what is my calculator doing to get the answer $3.32335097$ when I enter $2.5!$? Is there actually a definition of $2.5!$ or is my calculator just being weird? How is the factorial function implemented?

I understand the binary implications of $2.5$, so that could possibly have something to do with it. I get a domain error when trying to take the factorial of $-1, 2.3, e$, and any number that is not of the form $n/2$ where $n$ is any integer greater than $-2$.

share|cite|improve this question
up vote 17 down vote accepted

There is an extension of the factorial to "most" numbers (including complex numbers) called the Gamma Function, $\Gamma(z) = \int_0^\infty e^{-t} t^{z-1}dt$. It satisfies $\Gamma(n+1) = n!$, and more generally, that $\Gamma(z+1) = z\Gamma(z)$ for any number $z$.

It is a curious fact that $\Gamma\left(\frac{1}{2}\right) = \sqrt{\pi}$. Using this, together with the fact that $\Gamma(z+1) = z\Gamma(z)$, we get

\begin{align*}2.5! &= \Gamma(3.5) \\\ &= 2.5\cdot\Gamma(2.5) \\\ &= 2.5\cdot 1.5\cdot \Gamma(1.5) \\\ &= 2.5\cdot 1.5\cdot .5\cdot \Gamma(.5)\\\ &= 2.5\cdot 1.5\cdot .5\cdot \sqrt{\pi} \\\ &= 3.32335097... \end{align*}

share|cite|improve this answer

The other answers have already given nice explanations, so I shall instead be teaching a different lesson: as always, when confronted with seemingly peculiar behavior in your device, taking a look at your fine device's fine manual is almost always a profitable first step. As it turns out, looking at page 58 of your fine calculator's fine manual mentions the following:

calculator manual excerpt

So yes, do read the fine manual. ;)

As a further addition: there is what is called Gauss's duplication formula, which in factorial form goes as


This allows you to express factorials of semi-integers in terms of factorials and $\left(-\frac12\right)!=\sqrt \pi$.

share|cite|improve this answer

The factorial of a positive real number $s$ is defined as $$ s! = \int_0^\infty x^s \exp(-x) \mathrm{d} x $$ It is easy to verify, integrating by parts, that the definition satisfies the recurrence equation of the factorial: $$ \begin{eqnarray} s! &=& \int_0^\infty x^s \exp(-x) \mathrm{d} x = \int_0^\infty x^s \mathrm{d} (-\exp(-x) ) \\ &=& \left.\left(- x^s \exp(-x) \right) \right|_{x \downarrow 0}^{x \uparrow \infty} + s \int_0^\infty x^{s-1} \exp(-x) \mathrm{d} x = s (s-1)! \end{eqnarray} $$ The limit $\lim_{x \to +\infty} x^s \exp(-x) = \lim_{x \to +\infty} \frac{x^s}{\exp(x)} = 0$, since exponential function grows faster than any polynomial, and $\lim_{x \downarrow 0} x^s \exp(-x) \leqslant \lim_{x \downarrow 0} x^s = 0$, since $s$ was assumed positive.

The above, of course, is the celebrated Euler integral. It is worth noting, that Euler integral is not the only possible extension of factorial to positive real axis, but the only one which is logarithmically convex, see Bohr–Mollerup theorem.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.