about summary refs log tree commit diff
path: root/math/w_exp2l.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/w_exp2l.c')
-rw-r--r--math/w_exp2l.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/math/w_exp2l.c b/math/w_exp2l.c
index 442a637347..f05a8fe6d6 100644
--- a/math/w_exp2l.c
+++ b/math/w_exp2l.c
@@ -2,23 +2,18 @@
  * wrapper exp2l(x)
  */
 
-#include <float.h>
 #include <math.h>
 #include <math_private.h>
 
-static const long double o_threshold = (long double) LDBL_MAX_EXP;
-static const long double u_threshold
-  = (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG - 1);
-
 long double
 __exp2l (long double x)
 {
-  if (__builtin_expect (islessequal (x, u_threshold)
-			|| isgreater (x, o_threshold), 0)
-      && _LIB_VERSION != _IEEE_ && __finitel (x))
+  long double z = __ieee754_exp2l (x);
+  if (__builtin_expect (!__finitel (z), 0)
+      && __finitel (x) && _LIB_VERSION != _IEEE_)
     /* exp2 overflow: 244, exp2 underflow: 245 */
-    return __kernel_standard (x, x, 244 + (x <= o_threshold));
+    return __kernel_standard (x, x, 244 + !!__signbitl (x));
 
-  return __ieee754_exp2l (x);
+  return z;
 }
 weak_alias (__exp2l, exp2l)