diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2002-06-27 20:25:57 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2002-06-27 20:25:57 +0000 |
commit | c36e6dd754453b8f57767b19c58d2f832bac8bb0 (patch) | |
tree | 84759888d3048b553ba863df9d06c27b8e6cb8e5 /newlib/libm/mathfp/sf_tgamma.c | |
parent | baf051ca35b40c73e98f4b5246be50209cd966a6 (diff) | |
download | cygnal-c36e6dd754453b8f57767b19c58d2f832bac8bb0.tar.gz cygnal-c36e6dd754453b8f57767b19c58d2f832bac8bb0.tar.bz2 cygnal-c36e6dd754453b8f57767b19c58d2f832bac8bb0.zip |
* libm/mathfp/er_lgamma.c: Remove __kernel references.
* libm/mathfp/erf_lgamma.c: Likewise.
* libm/mathfp/s_tgamma.c: Likewise.
* libm/mathfp/sf_tgamma.c: Likewise.
Diffstat (limited to 'newlib/libm/mathfp/sf_tgamma.c')
-rw-r--r-- | newlib/libm/mathfp/sf_tgamma.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/newlib/libm/mathfp/sf_tgamma.c b/newlib/libm/mathfp/sf_tgamma.c index 11b7a37aa..f4d145634 100644 --- a/newlib/libm/mathfp/sf_tgamma.c +++ b/newlib/libm/mathfp/sf_tgamma.c @@ -14,6 +14,7 @@ */ #include <math.h> +#include <errno.h> #ifdef __STDC__ float tgammaf(float x) @@ -24,7 +25,7 @@ { float y; int local_signgam; - y = __ieee754_gammaf_r(x,&local_signgam); + y = gammaf_r(x,&local_signgam); if (local_signgam < 0) y = -y; #ifdef _IEEE_LIBM return y; @@ -33,11 +34,17 @@ if(!finitef(y)&&finitef(x)) { if(floorf(x)==x&&x<=(float)0.0) - /* tgammaf pole */ - return (float)__kernel_standard((double)x,(double)x,141); + { + /* tgammaf pole */ + errno = EDOM; + return HUGE_VAL; + } else - /* tgammaf overflow */ - return (float)__kernel_standard((double)x,(double)x,140); + { + /* tgammaf overflow */ + errno = ERANGE; + return HUGE_VAL; + } } return y; #endif |