1: # include   <sccs.h>
   2: 
   3: SCCSID(@(#)bitcnt.c	8.1	12/31/84)
   4: 
   5: 
   6: /*
   7: **	Count the number of 1's in the integer var. As long
   8: **	as left shift is zero fill this routine is machine
   9: **	independent.
  10: */
  11: 
  12: bitcnt(var)
  13: register int    var;
  14: {
  15:     register int    i, ret;
  16: 
  17:     for (ret = 0, i = 1; i; i <<= 1)
  18:         if (i & var)
  19:             ret++;
  20: 
  21:     return (ret);
  22: }

Defined functions

bitcnt defined in line 3; never used
Last modified: 1986-04-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 649
Valid CSS Valid XHTML 1.0 Strict