Back to index

glibc  2.9
Functions
s_logb.c File Reference
#include "math.h"
#include "math_private.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double __logb (double x)

Function Documentation

double __logb ( double  x)

Definition at line 29 of file s_logb.c.

{
       int32_t lx,ix;
       EXTRACT_WORDS(ix,lx,x);
       ix &= 0x7fffffff;                  /* high |x| */
       if((ix|lx)==0) return -1.0/fabs(x);
       if(ix>=0x7ff00000) return x*x;
       if((ix>>=20)==0)                   /* IEEE 754 logb */
              return -1022.0;
       else
              return (double) (ix-1023);
}

Here is the call graph for this function: