aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-11-21 19:58:34 +0000
committerUlrich Drepper <drepper@redhat.com>2004-11-21 19:58:34 +0000
commit52495f29a2e8519da83cbda0c21ad95405364705 (patch)
tree1ece157b55f4df330c2cbdc2b6cb276c57959476 /sysdeps/generic
parent250ecb48d516b08be7d0fdba0a7ba5146e148a77 (diff)
downloadglibc-52495f29a2e8519da83cbda0c21ad95405364705.tar
glibc-52495f29a2e8519da83cbda0c21ad95405364705.tar.gz
glibc-52495f29a2e8519da83cbda0c21ad95405364705.tar.bz2
glibc-52495f29a2e8519da83cbda0c21ad95405364705.zip
[BZ #552]
Update. 2004-11-20 Jakub Jelinek <jakub@redhat.com> * sysdeps/ieee754/k_standard.c: Document code 50. (__kernel_standard) <case 50>: Avoid raising div-by-zero exception again. 2004-11-19 H.J. Lu <hongjiu.lu@intel.com> [BZ #552] * math/libm-test.inc (tgamma_test): Update tgamma (0) and tgamma (-0). * sysdeps/generic/w_tgamma.c (__tgamma): Properly handle |x| == 0. * sysdeps/generic/w_tgammaf.c (__tgammaf): Likewise. * sysdeps/generic/w_tgammal.c (__tgammal): Likewise. * sysdeps/ieee754/dbl-64/e_gamma_r.c (__ieee754_gamma_r): Likewise. * sysdeps/ieee754/flt-32/e_gammaf_r.c: Likewise. * sysdeps/ieee754/ldbl-128/e_gammal_r.c: Likewise. * sysdeps/ieee754/ldbl-96/e_gammal_r.c: Likewise. * sysdeps/ieee754/k_standard.c (__kernel_standard): Handle tgamma (0) and tgamma (-0).
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/w_tgamma.c6
-rw-r--r--sysdeps/generic/w_tgammaf.c5
-rw-r--r--sysdeps/generic/w_tgammal.c6
3 files changed, 12 insertions, 5 deletions
diff --git a/sysdeps/generic/w_tgamma.c b/sysdeps/generic/w_tgamma.c
index 2adbc2e14d..6e34b62be4 100644
--- a/sysdeps/generic/w_tgamma.c
+++ b/sysdeps/generic/w_tgamma.c
@@ -39,8 +39,10 @@ static char rcsid[] = "$NetBSD: w_gamma.c,v 1.7 1995/11/20 22:06:43 jtc Exp $";
if(_LIB_VERSION == _IEEE_) return y;
if(!__finite(y)&&__finite(x)) {
- if(__floor(x)==x&&x<=0.0)
- return __kernel_standard(x,x,41); /* tgamma pole */
+ if (x == 0.0)
+ return __kernel_standard(x,x,50); /* tgamma pole */
+ else if(__floor(x)==x&&x<0.0)
+ return __kernel_standard(x,x,41); /* tgamma domain */
else
return __kernel_standard(x,x,40); /* tgamma overflow */
}
diff --git a/sysdeps/generic/w_tgammaf.c b/sysdeps/generic/w_tgammaf.c
index 152f4be156..e7b0d87ab5 100644
--- a/sysdeps/generic/w_tgammaf.c
+++ b/sysdeps/generic/w_tgammaf.c
@@ -37,8 +37,11 @@ static char rcsid[] = "$NetBSD: w_gammaf.c,v 1.4 1995/11/20 22:06:48 jtc Exp $";
if(_LIB_VERSION == _IEEE_) return y;
if(!__finitef(y)&&__finitef(x)) {
- if(__floorf(x)==x&&x<=(float)0.0)
+ if (x == (float)0.0)
/* tgammaf pole */
+ return (float)__kernel_standard((double)x,(double)x,150);
+ else if(__floorf(x)==x&&x<(float)0.0)
+ /* tgammaf domain */
return (float)__kernel_standard((double)x,(double)x,141);
else
/* tgammaf overflow */
diff --git a/sysdeps/generic/w_tgammal.c b/sysdeps/generic/w_tgammal.c
index 9efce2bb95..793fa17ac1 100644
--- a/sysdeps/generic/w_tgammal.c
+++ b/sysdeps/generic/w_tgammal.c
@@ -42,8 +42,10 @@ static char rcsid[] = "$NetBSD: $";
if(_LIB_VERSION == _IEEE_) return y;
if(!__finitel(y)&&__finitel(x)) {
- if(__floorl(x)==x&&x<=0.0)
- return __kernel_standard(x,x,241); /* tgamma pole */
+ if(x==0.0)
+ return __kernel_standard(x,x,250); /* tgamma pole */
+ else if(__floorl(x)==x&&x<0.0)
+ return __kernel_standard(x,x,241); /* tgamma domain */
else
return __kernel_standard(x,x,240); /* tgamma overflow */
}