29 #ifdef POK_NEEDS_LIBMATH
39 #include "math_private.h"
42 two54 = 1.80143985094819840000e+16,
43 twom54 = 5.55111512312578270212e-17,
48 scalbn(
double x,
int n)
51 EXTRACT_WORDS(hx,lx,x);
52 k = ((uint32_t)hx&0x7ff00000)>>20;
54 if ((lx|(hx&0x7fffffff))==0)
return x;
57 k = (((uint32_t)hx&0x7ff00000)>>20) - 54;
58 if (n< -50000)
return tiny*x;
60 if (k==0x7ff)
return x+x;
62 if (k > 0x7fe)
return huge*copysign(huge,x);
64 {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x;}
67 return huge*copysign(huge,x);
68 else return tiny*copysign(tiny,x);
71 SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));