Crates.io | count_set_bits |
lib.rs | count_set_bits |
version | 0.0.18 |
source | src |
created_at | 2024-06-12 19:20:57.149098 |
updated_at | 2024-06-15 12:26:59.55982 |
description | count set bits |
homepage | https://github.com/randymcmillan/count_set_bits |
repository | https://github.com/randymcmillan/count_set_bits |
max_upload_size | |
id | 1269904 |
size | 24,676 |
cargo add count_set_bits
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);
}