2006-01-08 Jakub Jelinek <jakub@redhat.com>
[glibc.git] / math / w_exp2l.c
blobfea5425ac462b7809bf89044eb64cee39c54df0d
1 /*
2 * wrapper exp2l(x)
3 */
5 #include <float.h>
6 #include <math.h>
7 #include "math_private.h"
9 static const long double o_threshold = (long double) LDBL_MAX_EXP;
10 static const long double u_threshold
11 = (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG - 1);
13 long double
14 __exp2l (long double x) /* wrapper exp2l */
16 #ifdef _IEEE_LIBM
17 return __ieee754_exp2l (x);
18 #else
19 long double z;
20 z = __ieee754_exp2l (x);
21 if (_LIB_VERSION != _IEEE_ && __finitel (x))
23 if (x > o_threshold)
24 return __kernel_standard (x, x, 244); /* exp2l overflow */
25 else if (x <= u_threshold)
26 return __kernel_standard (x, x, 245); /* exp2l underflow */
28 return z;
29 #endif
31 weak_alias (__exp2l, exp2l)