]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Correct result for NAN, Inf, 0.0.
authorUlrich Drepper <drepper@redhat.com>
Wed, 19 Nov 1997 23:43:24 +0000 (23:43 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 19 Nov 1997 23:43:24 +0000 (23:43 +0000)
sysdeps/libm-ieee754/s_cbrt.c
sysdeps/libm-ieee754/s_cbrtf.c
sysdeps/libm-ieee754/s_cbrtl.c

index a5033ff468f63d2ba00fd7d00fa4ece261243471..ddefdf14b6e4a00518f1c95c169dfbf03d0f341d 100644 (file)
@@ -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
index f9f687c011ce1d38bc8a26d3c2cd324e9dfe016f..b8e20044f86cad5ae0cb4531c69ad684f7424a46 100644 (file)
@@ -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
index b3a53a39e1a37b32a264ce106cc60fe5c16f35dc..4d718769c11b11f0f0cca89bc267fe817c55f8ef 100644 (file)
@@ -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