(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[glibc.git] / sysdeps / generic / w_exp2.c
blob4e667d770eb50a81193eae43aed574d3f52db0bf
1 /*
2 * wrapper exp2(x)
3 */
5 #include <float.h>
6 #include "math.h"
7 #include "math_private.h"
9 static const double o_threshold= (double) DBL_MAX_EXP;
10 static const double u_threshold= (double) (DBL_MIN_EXP - DBL_MANT_DIG - 1);
12 double
13 __exp2 (double x) /* wrapper exp2 */
15 #ifdef _IEEE_LIBM
16 return __ieee754_exp2 (x);
17 #else
18 double z;
19 z = __ieee754_exp2 (x);
20 if (_LIB_VERSION != _IEEE_ && __finite (x))
22 if (x > o_threshold)
23 /* exp2 overflow */
24 return __kernel_standard (x, x, 44);
25 else if (x <= u_threshold)
26 /* exp2 underflow */
27 return __kernel_standard (x, x, 45);
29 return z;
30 #endif
32 weak_alias (__exp2, exp2)
33 #ifdef NO_LONG_DOUBLE
34 strong_alias (__exp2, __expl2)
35 weak_alias (__exp2, expl2)
36 #endif