/* input a float number ouput the IEEE float save status by bits and hexadecimal format made by F.Camel 2002/11/07 */ #include void output(unsigned long *n) { int i, j, hex_out; int bits[32]; for (i=0; i<32; i++, *n >>= 1) bits[i] = *n & 1; for (i=31; i>=0; i--) putchar(bits[i]+'0'); putchar('\n'); for (i=7; i>=0; i--) { hex_out = 0; for (j=i*4+3; j>=i*4; j--) hex_out = (hex_out<<1) + bits[j]; printf("%x", hex_out); } putchar('\n'); } int main(void) { float n; while (scanf("%f", &n) == 1) { printf("%.32f\n", n); output((unsigned long*)&n); } return 0; }