#include <stdio.h>

unsigned long bits0(unsigned long num) {
	int count = 0; while(num) num >>=1, ++count; return count;	
}

unsigned long bits1(unsigned long num) {
  int float_order_le = 1;
  union { unsigned int u[2]; double d; } t;
  t.u[float_order_le] = 0x43300000;
  t.u[!float_order_le] = num;
  t.d -= 4503599627370496.0;	
  return ((t.u[float_order_le] >> 20) - 0x3FF) + 1;
}

int main(int argc, char **argv) {
  unsigned long d = 0x01000001;
  printf("%lu\n%lu", bits0(d), bits1(d));

  return 0;
}