#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
typedef union
{
double f;
uint32_t i[2];
}Packet;
#define M ((1<<20)-1)
void test( double f)
{
Packet p;
p.f=f;
printf("f1 = %.16f ~= (1.0+%u/2^20)*2^%u\n", p.f, p.i[1]&M, (p.i[1]>>20)-1023 );
}
int main(int argc, char* argv[] )
{
double f;
printf("Please input a double?");
scanf("%lf",&f);
test(f);
return 0;
}