diff options
Diffstat (limited to 'sysdeps/libm-ieee754')
-rw-r--r-- | sysdeps/libm-ieee754/s_cbrt.c | 6 | ||||
-rw-r--r-- | sysdeps/libm-ieee754/s_cbrtf.c | 6 | ||||
-rw-r--r-- | sysdeps/libm-ieee754/s_cbrtl.c | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/sysdeps/libm-ieee754/s_cbrt.c b/sysdeps/libm-ieee754/s_cbrt.c index a5033ff..753049d 100644 --- a/sysdeps/libm-ieee754/s_cbrt.c +++ b/sysdeps/libm-ieee754/s_cbrt.c @@ -46,8 +46,10 @@ __cbrt (double x) xm = __frexp (fabs (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.354895765043919860 diff --git a/sysdeps/libm-ieee754/s_cbrtf.c b/sysdeps/libm-ieee754/s_cbrtf.c index f9f687c..fa0fef9 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 diff --git a/sysdeps/libm-ieee754/s_cbrtl.c b/sysdeps/libm-ieee754/s_cbrtl.c index b3a53a3..1d021b7 100644 --- a/sysdeps/libm-ieee754/s_cbrtl.c +++ b/sysdeps/libm-ieee754/s_cbrtl.c @@ -48,8 +48,10 @@ __cbrtl (long double x) xm = __frexpl (fabs (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.338058687610520237 |