w_gamma_r.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * ====================================================
  3. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  4. *
  5. * Developed at SunPro, a Sun Microsystems, Inc. business.
  6. * Permission to use, copy, modify, and distribute this
  7. * software is freely granted, provided that this notice
  8. * is preserved.
  9. * ====================================================
  10. */
  11. /*
  12. * wrapper double gamma_r(double x, int *signgamp)
  13. */
  14. #include "math.h"
  15. #include "math_private.h"
  16. double gamma_r(double x, int *signgamp);
  17. libm_hidden_proto(gamma_r)
  18. double gamma_r(double x, int *signgamp) /* wrapper lgamma_r */
  19. {
  20. #ifdef _IEEE_LIBM
  21. return __ieee754_lgamma_r(x,signgamp);
  22. #else
  23. double y;
  24. y = __ieee754_lgamma_r(x,signgamp);
  25. if(_LIB_VERSION == _IEEE_) return y;
  26. if(!isfinite(y)&&isfinite(x)) {
  27. if(floor(x)==x&&x<=0.0)
  28. return __kernel_standard(x,x,41); /* gamma pole */
  29. else
  30. return __kernel_standard(x,x,40); /* gamma overflow */
  31. } else
  32. return y;
  33. #endif
  34. }
  35. libm_hidden_def(gamma_r)