crypto_bigint/limb/
bits.rs

1
2
3
4
5
6
7
8
use super::Limb;

impl Limb {
    /// Calculate the number of bits needed to represent this number.
    pub const fn bits(self) -> usize {
        Limb::BIT_SIZE - (self.0.leading_zeros() as usize)
    }
}