Back to index

glibc  2.9
w_exp2l.c
Go to the documentation of this file.
00001 /*
00002  * wrapper exp2l(x)
00003  */
00004 
00005 #include <float.h>
00006 #include <math.h>
00007 #include "math_private.h"
00008 
00009 static const long double o_threshold = (long double) LDBL_MAX_EXP;
00010 static const long double u_threshold
00011   = (long double) (LDBL_MIN_EXP - LDBL_MANT_DIG - 1);
00012 
00013 long double
00014 __exp2l (long double x)                   /* wrapper exp2l */
00015 {
00016 #ifdef _IEEE_LIBM
00017   return __ieee754_exp2l (x);
00018 #else
00019   long double z;
00020   z = __ieee754_exp2l (x);
00021   if (_LIB_VERSION != _IEEE_ && __finitel (x))
00022     {
00023       if (x > o_threshold)
00024        return __kernel_standard (x, x, 244); /* exp2l overflow */
00025       else if (x <= u_threshold)
00026        return __kernel_standard (x, x, 245); /* exp2l underflow */
00027     }
00028   return z;
00029 #endif
00030 }
00031 weak_alias (__exp2l, exp2l)