w_lgammaf_r.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* w_lgammaf_r.c -- float version of w_lgamma_r.c.
  2. * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
  3. */
  4. /*
  5. * ====================================================
  6. * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  7. *
  8. * Developed at SunPro, a Sun Microsystems, Inc. business.
  9. * Permission to use, copy, modify, and distribute this
  10. * software is freely granted, provided that this notice
  11. * is preserved.
  12. * ====================================================
  13. */
  14. /*
  15. * wrapper float lgammaf_r(float x, int *signgamp)
  16. */
  17. #include <math.h>
  18. #include "math_private.h"
  19. libm_hidden_proto(lgammaf_r)
  20. float
  21. lgammaf_r (float x, int *signgamp)
  22. {
  23. #if __UCLIBC_HAS_FENV__
  24. float y = (float) __ieee754_lgamma_r ((double)x,signgamp);
  25. if(__builtin_expect(!isfinite(y), 0)
  26. && isfinite(x) && _LIB_VERSION != _IEEE_)
  27. return __kernel_standard_f(x, x,
  28. floorf(x)==x&&x<=0.0f
  29. ? 115 /* lgamma pole */
  30. : 114); /* lgamma overflow */
  31. return y;
  32. #else
  33. return (float) __ieee754_lgamma_r ((double)x,signgamp);
  34. #endif
  35. }
  36. libm_hidden_def(lgammaf_r)