arnaucube
arnaucube/sonobePublic Self-hosted repository
sonobe/folding-schemes/src/utils/bit.rs
folding-schemes/src/utils/bit.rsRaw
1pub fn bit_decompose(input: u64, n: usize) -> Vec<bool> {
2    let mut res = Vec::with_capacity(n);
3    let mut i = input;
4    for _ in 0..n {
5        res.push(i & 1 == 1);
6        i >>= 1;
7    }
8    res
9}