malachite-nz 0.3.2

The bignum types Natural and Integer, with efficient algorithms partially derived from GMP and FLINT
Documentation
use crate::natural::Natural;
use malachite_base::num::basic::traits::{One, Zero};

pub fn ceiling_log_base_power_of_2_naive_nz(x: &Natural, pow: u64) -> u64 {
    assert_ne!(*x, Natural::ZERO);
    assert_ne!(pow, 0);
    let mut result = 0;
    let mut p = Natural::ONE;
    while p < *x {
        result += 1;
        p <<= pow;
    }
    result
}