SYNOPSIS

int count_bits( string str)

DESCRIPTION

Count the number of set bits in bitstring str and return the number as result.

USAGE

Here’s a very simple example:

string s;

s = set_bit("", 3);
s = set_bit(s, 15);

count_bits(s) // returns 2