From c36e6dd754453b8f57767b19c58d2f832bac8bb0 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Thu, 27 Jun 2002 20:25:57 +0000 Subject: * 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. --- newlib/libm/mathfp/s_tgamma.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'newlib/libm/mathfp/s_tgamma.c') diff --git a/newlib/libm/mathfp/s_tgamma.c b/newlib/libm/mathfp/s_tgamma.c index 2dec8d7e4..4caf27089 100644 --- a/newlib/libm/mathfp/s_tgamma.c +++ b/newlib/libm/mathfp/s_tgamma.c @@ -16,6 +16,7 @@ */ #include +#include #ifdef __STDC__ double tgamma(double x) @@ -26,7 +27,7 @@ { double y; int local_signgam; - y = __ieee754_gamma_r(x,&local_signgam); + y = gamma_r(x,&local_signgam); if (local_signgam < 0) y = -y; #ifdef _IEEE_LIBM return y; @@ -35,9 +36,17 @@ if(!finite(y)&&finite(x)) { if(floor(x)==x&&x<=0.0) - return __kernel_standard(x,x,41); /* tgamma pole */ + { + /* tgamma pole */ + errno = EDOM; + return HUGE_VAL; + } else - return __kernel_standard(x,x,40); /* tgamma overflow */ + { + /* tgamma overflow */ + errno = ERANGE; + return HUGE_VAL; + } } return y; #endif -- cgit v1.2.3