6.4.17. The logarithm of the gamma function (lgamma, lgamma_r)

These functions compute the logarithm of the absolute value of the gamma function of x. The sign of the function is returned separately, so that the two can be used to compute the actual gamma function of x.

double lgamma(double x);double lgamma_r(double x, int *sign);

lgamma returns the sign of the gamma function of x in the global variable signgam. lgamma_r returns it in a user variable, whose address is passed in the sign parameter. The value, in either case, is either +1 or –1.

Both functions return an ERANGE error if the answer is too big to fit in a double.

Both functions return an EDOM error if x is zero or a negative integer.

Copyright © 2005 ARM Limited. All rights reserved.ARM DUI 0282B
Non-Confidential