Back to index

glibc  2.9
w_exp2f.c
Go to the documentation of this file.
00001 /*
00002  * wrapper exp2f(x)
00003  */
00004 
00005 #include <float.h>
00006 #include <math.h>
00007 #include "math_private.h"
00008 
00009 static const float o_threshold= (float) FLT_MAX_EXP;
00010 static const float u_threshold= (float) (FLT_MIN_EXP - FLT_MANT_DIG - 1);
00011 
00012 float
00013 __exp2f (float x)           /* wrapper exp2f */
00014 {
00015 #ifdef _IEEE_LIBM
00016   return __ieee754_exp2f (x);
00017 #else
00018   float z;
00019   z = __ieee754_exp2f (x);
00020   if (_LIB_VERSION != _IEEE_ && __finitef (x))
00021     {
00022       if (x > o_threshold)
00023        /* exp2 overflow */
00024        return (float) __kernel_standard ((double) x, (double) x, 144);
00025       else if (x <= u_threshold)
00026        /* exp2 underflow */
00027        return (float) __kernel_standard ((double) x, (double) x, 145);
00028     }
00029   return z;
00030 #endif
00031 }
00032 weak_alias (__exp2f, exp2f)