10 ways to impliment factorial in Mathematica by nikitaud

D7dd5ca1be28a5976334898a2d7664cd?size=52
Factorial[n]
Gamma[n + 1]
Product[i, {i, 1, n}]
q = 1; For[i = 1, i < n + 1, i++, q = q*i]
q = 1; While[n != 1, q = q*n; n--]
Times @@ Range[n]
g[1] := 1; g[n_] := g[n - 1] n
i = n; Nest[i--; # * i &, # , # ] & [n]
D[x^n,{x,n}]
FixedPoint[# /. {fact[0] -> 1, fact[n_] :> n fact[n - 1]} &, fact[n]]

#mathematica