about summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/s_cbrtf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_cbrtf.c')
-rw-r--r--sysdeps/libm-ieee754/s_cbrtf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/libm-ieee754/s_cbrtf.c b/sysdeps/libm-ieee754/s_cbrtf.c
index f9f687c011..fa0fef9987 100644
--- a/sysdeps/libm-ieee754/s_cbrtf.c
+++ b/sysdeps/libm-ieee754/s_cbrtf.c
@@ -46,8 +46,10 @@ __cbrtf (float x)
   xm = __frexpf (fabsf (x), &xe);
 
   /* If X is not finite or is null return it (with raising exceptions
-     if necessary.  */
-  if (xe == 0)
+     if necessary.
+     Note: *Our* version of `frexp' sets XE to zero if the argument is
+     Inf or NaN.  This is not portable but faster.  */
+  if (xe == 0 && fpclassify (x) <= FP_ZERO)
     return x + x;
 
   u = (0.492659620528969547 + (0.697570460207922770