
#include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>
#include <err.h>

typedef unsigned long long ULL;

#define N (8 * sizeof (ULL))

int main (int argc, char *argv[])
{
   double a;
   ULL* p = (ULL*) &a;
   int i;
   char b[N+1];

   if (argc != 2) {
      errx(EX_USAGE,"Usage: ieee754 <float>");
      exit(1);
   } else
      a = atof(argv[1]);

   p = (ULL*) &a;

   for (i = N - 1; i >= 0; --i) {
      b[i] = *p & 1 ? '1' : '0';
      *p >>= 1;
   }
   b[N] = '\0';
   printf ("%s\n", b); 

   return EX_OK;
}


