count_set_bits

Crates.iocount_set_bits
lib.rscount_set_bits
version0.0.18
sourcesrc
created_at2024-06-12 19:20:57.149098
updated_at2024-06-15 12:26:59.55982
descriptioncount set bits
homepagehttps://github.com/randymcmillan/count_set_bits
repositoryhttps://github.com/randymcmillan/count_set_bits
max_upload_size
id1269904
size24,676
@RandyMcMillan (RandyMcMillan)

documentation

https://github.com/randymcmillan/count_set_bits

README

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);
}
Commit count: 67

cargo fmt