summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/k_standard.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-11-21 11:42:09 +0000
committerJakub Jelinek <jakub@redhat.com>2004-11-21 11:42:09 +0000
commitb640e88eff2f0c60d1604382c15a147a2373f6d1 (patch)
treef7d8c9841b3b9163b5c13f49f44c27015a0f2ec6 /sysdeps/ieee754/k_standard.c
parentf2fad0ae26d274bd203ba350a66b6f2bec3f6740 (diff)
downloadglibc-b640e88eff2f0c60d1604382c15a147a2373f6d1.tar
glibc-b640e88eff2f0c60d1604382c15a147a2373f6d1.tar.gz
glibc-b640e88eff2f0c60d1604382c15a147a2373f6d1.tar.bz2
glibc-b640e88eff2f0c60d1604382c15a147a2373f6d1.zip
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/ieee754/k_standard.c')
-rw-r--r--sysdeps/ieee754/k_standard.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/sysdeps/ieee754/k_standard.c b/sysdeps/ieee754/k_standard.c
index 6def34bc0c..d8fa2a4493 100644
--- a/sysdeps/ieee754/k_standard.c
+++ b/sysdeps/ieee754/k_standard.c
@@ -90,6 +90,7 @@ static double zero = 0.0; /* used as const */
* 47-- exp10 underflow
* 48-- log2(0)
* 49-- log2(x<0)
+ * 50-- tgamma(+-0)
*/
@@ -832,7 +833,7 @@ static double zero = 0.0; /* used as const */
case 40:
case 140:
case 240:
- /* gamma(finite) overflow */
+ /* tgamma(finite) overflow */
exc.type = OVERFLOW;
exc.name = type < 100 ? "tgamma" : (type < 200
? "tgammaf" : "tgammal");
@@ -846,7 +847,7 @@ static double zero = 0.0; /* used as const */
case 41:
case 141:
case 241:
- /* gamma(-integer) or gamma(0) */
+ /* tgamma(-integer) */
exc.type = SING;
exc.name = type < 100 ? "tgamma" : (type < 200
? "tgammaf" : "tgammal");
@@ -973,8 +974,24 @@ static double zero = 0.0; /* used as const */
__set_errno (EDOM);
}
break;
+ case 50:
+ case 150:
+ case 250:
+ /* tgamma(+-0) */
+ exc.type = SING;
+ exc.name = type < 100 ? "tgamma" : (type < 200
+ ? "tgammaf" : "tgammal");
+ exc.retval = __copysign (HUGE_VAL, x);
+ if (_LIB_VERSION == _POSIX_)
+ __set_errno (ERANGE);
+ else if (!matherr(&exc)) {
+ if (_LIB_VERSION == _SVID_)
+ (void) WRITE2("tgamma: SING error\n", 18);
+ __set_errno (ERANGE);
+ }
+ break;
- /* #### Last used is 49/149/249 ### */
+ /* #### Last used is 50/150/250 ### */
}
return exc.retval;
}