00001 00002 // printbits: print significant nonzero bits of an unsigned integer. 00003 00004 #include "stdinc.h" 00005 00006 void printbits(unsigned int i) 00007 { 00008 int n = 31; 00009 while (n >= 0) {if (GETBIT(i, n)) break; n--;} 00010 while (n >= 0) {if (GETBIT(i, n)) cerr << "1"; else cerr << "0"; n--;} 00011 }