count_bits

ldmud-3.3.719/doc/efun/count_bits · 414 B

From the archive ldmud-3.3.719.tar.gz

Download the archive   « Back to the archive contents

SYNOPSIS
        int count_bits (string str)

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

EXAMPLES
        string s;

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

        count_bits(s) --> returns 2

SEE ALSO
        clear_bit(E), set_bit(E), test_bit(E), next_bit(E), last_bit(E),
        or_bits(E), xor_bits(E), invert_bits(E), copy_bits(E)

Site Stats

Snippets: 1791
Codebases: 571