/* -*- compile-command: "g++ format.cc -o format" -*- */
#include <iostream>
using namespace std;

void printdouble(double d){
  int l,j;
  unsigned char tmp;
  unsigned char * ptr=(unsigned char *) &d;
  l=sizeof(double)/sizeof(unsigned char);
  char tab[8];
  for (j=0,ptr+=l-1;j<l;++j,--ptr){
    tmp = *ptr;
    printf("%x (",tmp);
    for (int k=0;k<8;k++,tmp /= 2 )
      tab[k]=tmp%2;
    for (int k=0;k<8;k++)
      printf("%x",tab[7-k]);
    printf("), ");
  }
  printf("\n");
}

int main(){
  double d;
  printf("Entrez des nombres reels pour avoir leur representation machine\n");
  for (;;){
    cin >> d;
    printdouble(d);
  }
  return 0;
}

