(o_threshold, u_threshold): Remove.
authordrepper <drepper>
Wed, 6 Jun 2001 12:39:30 +0000 (12:39 +0000)
committerdrepper <drepper>
Wed, 6 Jun 2001 12:39:30 +0000 (12:39 +0000)
Test if finite argument gave non-finite result.

sysdeps/generic/w_exp10.c
sysdeps/generic/w_exp10f.c
sysdeps/generic/w_exp10l.c

index bf0d361..597506f 100644 (file)
 #include "math_private.h"
 
 #ifdef __STDC__
-static const double
-#else
-static double
-#endif
-o_threshold=  3.0825471555991674389672e+02,
-u_threshold= -3.2360724533877978485251e+02;
-
-#ifdef __STDC__
        double __exp10(double x)                /* wrapper exp10 */
 #else
        double __exp10(x)                       /* wrapper exp10 */
@@ -41,11 +33,9 @@ u_threshold= -3.2360724533877978485251e+02;
        double z;
        z = __ieee754_exp10(x);
        if(_LIB_VERSION == _IEEE_) return z;
-       if(__finite(x)) {
-           if(x>o_threshold)
-               return __kernel_standard(x,x,46); /* exp10 overflow */
-           else if(x<u_threshold)
-               return __kernel_standard(x,x,47); /* exp10 underflow */
+       if(!__finite(z) && __finite(x)) {
+           /* exp10 overflow (46) if x > 0, underflow (47) if x < 0.  */
+           return __kernel_standard(x,x,46+!!__signbit(x));
        }
        return z;
 #endif
index f78be79..1c510a3 100644 (file)
 #include "math_private.h"
 
 #ifdef __STDC__
-static const float
-#else
-static float
-#endif
-o_threshold=  3.853183944498959298709e+01,
-u_threshold= -4.515449934959717928174e+01;
-
-#ifdef __STDC__
        float __exp10f(float x)         /* wrapper exp10f */
 #else
        float __exp10f(x)                       /* wrapper exp10f */
@@ -41,13 +33,10 @@ u_threshold= -4.515449934959717928174e+01;
        float z;
        z = __ieee754_exp10f(x);
        if(_LIB_VERSION == _IEEE_) return z;
-       if(__finitef(x)) {
-           if(x>o_threshold)
-               /* exp overflow */
-               return (float)__kernel_standard((double)x,(double)x,146);
-           else if(x<u_threshold)
-               /* exp underflow */
-               return (float)__kernel_standard((double)x,(double)x,147);
+       if(!__finitef(z) && __finitef(x)) {
+           /* exp10f overflow (146) if x > 0, underflow (147) if x < 0.  */
+           return (float)__kernel_standard((double) x, (double) x,
+                                           146+!!__signbitf(x));
        }
        return z;
 #endif
index 7117873..aebddcb 100644 (file)
 #include "math_private.h"
 
 #ifdef __STDC__
-static const long double
-#else
-static long double
-#endif
-o_threshold=  4.93207544895866790234755e+03,
-u_threshold= -4.95104033868549871764588e+03;
-
-#ifdef __STDC__
        long double __exp10l(long double x)     /* wrapper exp10 */
 #else
        long double __exp10l(x)                 /* wrapper exp10 */
@@ -42,11 +34,9 @@ u_threshold= -4.95104033868549871764588e+03;
        long double z;
        z = __ieee754_exp10l(x);
        if(_LIB_VERSION == _IEEE_) return z;
-       if(__finitel(x)) {
-           if(x>o_threshold)
-               return __kernel_standard(x,x,246); /* exp10 overflow */
-           else if(x<u_threshold)
-               return __kernel_standard(x,x,247); /* exp10 underflow */
+       if(!__finitel(z) && __finitel(x)) {
+           /* exp10 overflow (246) if x > 0, underflow (247) if x < 0.  */
+           return __kernel_standard(x,x,246+__signbitl(x));
        }
        return z;
 #endif