123456789101112131415161718192021222324252627282930313233 |
- #include "math.h"
- #include "math_private.h"
- double logb(double x)
- {
- int32_t lx,ix;
- EXTRACT_WORDS(ix,lx,x);
- ix &= 0x7fffffff;
- if((ix|lx)==0) return -1.0/fabs(x);
- if(ix>=0x7ff00000) return x*x;
- if((ix>>=20)==0)
- return -1022.0;
- else
- return (double) (ix-1023);
- }
- libm_hidden_def(logb)
|