w_lgammaf_main.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* w_lgammaf.c -- float version of w_lgamma.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. #include <math.h>
  15. #include <math_private.h>
  16. #include <math-svid-compat.h>
  17. #include <libm-alias-float.h>
  18. #include <lgamma-compat.h>
  19. #if BUILD_LGAMMA
  20. float
  21. LGFUNC (__lgammaf) (float x)
  22. {
  23. float y = CALL_LGAMMA (float, __ieee754_lgammaf_r, x);
  24. if(__builtin_expect(!isfinite(y), 0)
  25. && isfinite(x) && _LIB_VERSION != _IEEE_)
  26. return __kernel_standard_f(x, x,
  27. floorf(x)==x&&x<=0.0f
  28. ? 115 /* lgamma pole */
  29. : 114); /* lgamma overflow */
  30. return y;
  31. }
  32. # if USE_AS_COMPAT
  33. compat_symbol (libm, __lgammaf_compat, lgammaf, LGAMMA_OLD_VER);
  34. # else
  35. versioned_symbol (libm, __lgammaf, lgammaf, LGAMMA_NEW_VER);
  36. libm_alias_float_other (__lgamma, lgamma)
  37. # endif
  38. # if GAMMA_ALIAS
  39. strong_alias (LGFUNC (__lgammaf), __gammaf)
  40. weak_alias (__gammaf, gammaf)
  41. # endif
  42. #endif