Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

printbits.C

Go to the documentation of this file.
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 }

Generated at Sun Feb 24 09:57:12 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001