1: bitcnt(var)
   2: int var;
   3: 
   4: /*
   5: **	Count the number of 1's in the integer var. As long
   6: **	as left shift is zero fill this routine is machine
   7: **	independent.
   8: */
   9: 
  10: {
  11:     register int    i, j, ret;
  12: 
  13:     j = var;
  14: 
  15:     for (ret = 0, i = 1; i; i <<= 1)
  16:         if (i & j)
  17:             ret++;
  18: 
  19:     return (ret);
  20: }
Last modified: 1995-02-04
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1790
Valid CSS Valid XHTML 1.0 Strict