#include <stdio.h>

#define BYTEBIN "%d%d%d%d%d%d%d%d"
#define BYTE2BIN(byte)  \
  (byte & 0x80 ? 1 : 0), \
  (byte & 0x40 ? 1 : 0), \
  (byte & 0x20 ? 1 : 0), \
  (byte & 0x10 ? 1 : 0), \
  (byte & 0x08 ? 1 : 0), \
  (byte & 0x04 ? 1 : 0), \
  (byte & 0x02 ? 1 : 0), \
  (byte & 0x01 ? 1 : 0) 

int main(void) {
	float fa = 0.999999f;
	
	unsigned int *ia = (unsigned int*)&fa;
	unsigned char *ba = (unsigned char*)&fa;
	printf("float %f in binary: "BYTEBIN" "BYTEBIN" "BYTEBIN" "BYTEBIN"\n",
	  fa, BYTE2BIN(ba[3]), BYTE2BIN(ba[2]), BYTE2BIN(ba[1]), BYTE2BIN(ba[0]));
	  
	return 0;
}
