The gamma function is a generalisation of the factorial function to include fractional and negative numbers. It is extremely important in mathematical statistics. loggamma(x) is identical to log(abs(gamma(x))), but it remains valid up to much larger values of x. In C, these functions are called 'tgamma' and 'lgamma' for obscure historical reasons. sgnGamma(x) gives the sign (gamma is always positive for x>0, but the sign alternates regularly for negative x).
