12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #if defined(LIBM_SCCS) && !defined(lint)
- static char rcsid[] = "$NetBSD: w_gamma.c,v 1.7 1995/11/20 22:06:43 jtc Exp $";
- #endif
- #include "math.h"
- #include "math_private.h"
- extern int signgam;
- #ifdef __STDC__
- double gamma(double x)
- #else
- double gamma(x)
- double x;
- #endif
- {
- #ifdef _IEEE_LIBM
- return __ieee754_lgamma_r(x,&signgam);
- #else
- double y;
- y = __ieee754_lgamma_r(x,&signgam);
- if(_LIB_VERSION == _IEEE_) return y;
- if(!finite(y)&&finite(x)) {
- if(floor(x)==x&&x<=0.0)
- return __kernel_standard(x,x,41);
- else
- return __kernel_standard(x,x,40);
- } else
- return y;
- #endif
- }
|