36 if((uint64_t)v+v > 0xFFEULL<<52)
38 return ldexp(((v&((1LL<<52)-1)) + (1LL<<52)) * (v>>63|1), (v>>52&0x7FF)-1075);
42 if((uint32_t)v+v > 0xFF000000U)
44 return ldexp(((v&0x7FFFFF) + (1<<23)) * (v>>31|1), (v>>23&0xFF)-150);
51 for (i = 0; i < 8; i++)
67 else if(d-d)
return 0x7FF0000000000000LL + ((int64_t)(d<0)<<63) + (d!=d);
69 return (int64_t)(d<0)<<63 | (e+1022LL)<<52 | (int64_t)((fabs(d)-0.5)*(1LL<<53));
75 else if(d-d)
return 0x7F800000 + ((d<0)<<31) + (d!=d);
77 return (d<0)<<31 | (e+126)<<23 | (int64_t)((fabs(d)-0.5)*(1<<24));
82 int e, i;
double f; uint64_t
m;
84 f = fabs(frexp(d, &e));
85 if (f >= 0.5 && f < 1) {
89 m = (uint64_t)ldexp(f, 64);
92 }
else if (f != 0.0) {