Function reference · Special functions

gamma

Returns the gamma function.

For a positive integer n, gamma(n) is (n-1)!. Half-integers give exact values with sqrt(pi). Zero and negative integers, where gamma is undefined, throw an error. Call evaluate for a decimal value.

Notation

gamma(args)

Write it in an expression: nerdamer('gamma(5)'), or in the Playground.

nerdamer.gamma

nerdamer.gamma(...args: [x]): Expression

A method on the default import. Arguments can be strings, as in Notation.

import { gamma }

import { gamma } from 'nerdamer/special';
gamma(x: Expression): Expression

Import only this function, from nerdamer/special.

Examples

4!.

gamma(5)
// → 24
Open in Playground

An exact half-integer value.

gamma(1/2)
// → pi^(1/2)
Open in Playground

A decimal value.

evaluate(gamma(2.5))
// → 1.3293403881791370205
Open in Playground

← Back to Function reference