Factorial

is a monadic scalar function which gives the factorial of a non-negative integer. Factorial takes its glyph  from traditional mathematics but, like all monadic functions, takes its argument on the right    instead of traditional mathematics' $$Y!$$. It shares the glyph with the dyadic arithmetic function Binomial.

Examples
The factorial of a positive integer n is defined as the product of 1 to n inclusive.

Extended definition
In multiple implementations, this function has an extended definition using the Gamma function $$\Gamma(n)$$, so that it is defined for real and complex numbers. Because $$\Gamma(n)$$ equals $$(n-1)!$$,  is defined as $$\Gamma(Y+1)$$.

The Gamma function diverges at 0 or negative numbers, so  is undefined at negative integers.

In J, where literal infinity is supported, negative integer factorial evaluates to positive infinity  (if the argument is odd) or negative infinity   (if even). This corresponds to the positive-side limit of the Gamma function.

Documentation

 * Dyalog
 * APLX
 * J Dictionary, NuVoc