Standard library / math

math.Gamma()

Gamma function; for positive integers n it equals (n-1) factorial. Expected stdout: '24\n'.

Formal Syntax & Structure

go syntaxgo
func Gamma(x float64) float64

Parameters & Attributes

NameTypeDescription
xfloat64First input operand (or sole input if unary).

Return Value

float64

Gamma function; for positive integers n it equals (n-1) factorial.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(math.Gamma(5))}
Go Reference