11 个版本

0.0.18 2024 年 6 月 15 日
0.0.14 2024 年 6 月 15 日

#13#set-bit

Download history · Rust 包仓库 612/week @ 2024-06-12 · Rust 包仓库 30/week @ 2024-06-19 · Rust 包仓库 3/week @ 2024-07-17 · Rust 包仓库 88/week @ 2024-07-24 · Rust 包仓库

91 每月下载

Apache-2.0

11KB
180 代码行

count_set_bits 发布 Rust

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);
}

无运行时依赖