Back to index

glibc  2.9
w_log2f.c
Go to the documentation of this file.
00001 /*
00002  * wrapper log2(X)
00003  */
00004 
00005 #include <math.h>
00006 #include "math_private.h"
00007 
00008 float
00009 __log2f (float x)    /* wrapper log2f */
00010 {
00011 #ifdef _IEEE_LIBM
00012   return __ieee754_log2f (x);
00013 #else
00014   float z;
00015   z = __ieee754_log2f (x);
00016   if (_LIB_VERSION == _IEEE_ || __isnanf (x)) return z;
00017   if (x <= 0.0f)
00018     {
00019       if (x == 0.0f)
00020        /* log2f (0) */
00021        return __kernel_standard ((double) x, (double) x, 148);
00022       else
00023        /* log2f (x < 0) */
00024        return __kernel_standard ((double) x, (double) x, 149);
00025     }
00026   else
00027     return z;
00028 #endif
00029 }
00030 weak_alias (__log2f, log2f)