11 releases

0.0.18 Jun 15, 2024
0.0.14 Jun 15, 2024

#12 in #set-bit

Download history 3/week @ 2024-10-12 2/week @ 2024-11-02 9/week @ 2024-12-07 7/week @ 2024-12-14

305 downloads per month

Apache-2.0

11KB
180 lines

count_set_bits Release Rust

cargo add count_set_bits

main example

use count_set_bits::count_set_bits;
fn main() {
    let num = 13; // Example usage, change x as needed
    let set_bits = count_set_bits(num.try_into().unwrap(), true);

    println!("\nNumber of set bits in {}: {}", num, set_bits);
}

No runtime deps