From 24f24fa2c86a2aac7322b540eda0a951d7e9311d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 19 Nov 1997 23:43:24 +0000 Subject: [PATCH] Correct result for NAN, Inf, 0.0. --- sysdeps/libm-ieee754/s_cbrt.c | 2 +- sysdeps/libm-ieee754/s_cbrtf.c | 2 +- sysdeps/libm-ieee754/s_cbrtl.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdeps/libm-ieee754/s_cbrt.c b/sysdeps/libm-ieee754/s_cbrt.c index a5033ff468f..ddefdf14b6e 100644 --- a/sysdeps/libm-ieee754/s_cbrt.c +++ b/sysdeps/libm-ieee754/s_cbrt.c @@ -47,7 +47,7 @@ __cbrt (double x) /* If X is not finite or is null return it (with raising exceptions if necessary. */ - if (xe == 0) + if (xe == 0 && (x == 0.0 || isnan (x) || isinf (x))) return x + x; u = (0.354895765043919860 diff --git a/sysdeps/libm-ieee754/s_cbrtf.c b/sysdeps/libm-ieee754/s_cbrtf.c index f9f687c011c..b8e20044f86 100644 --- a/sysdeps/libm-ieee754/s_cbrtf.c +++ b/sysdeps/libm-ieee754/s_cbrtf.c @@ -47,7 +47,7 @@ __cbrtf (float x) /* If X is not finite or is null return it (with raising exceptions if necessary. */ - if (xe == 0) + if (xe == 0 && (x == 0.0 || isnanf (x) || isinff (x))) return x + x; u = (0.492659620528969547 + (0.697570460207922770 diff --git a/sysdeps/libm-ieee754/s_cbrtl.c b/sysdeps/libm-ieee754/s_cbrtl.c index b3a53a39e1a..4d718769c11 100644 --- a/sysdeps/libm-ieee754/s_cbrtl.c +++ b/sysdeps/libm-ieee754/s_cbrtl.c @@ -49,7 +49,7 @@ __cbrtl (long double x) /* If X is not finite or is null return it (with raising exceptions if necessary. */ - if (xe == 0) + if (xe == 0 && (x == 0.0 || isnanl (x) || isinfl (x))) return x + x; u = (0.338058687610520237 -- 2.47.2