1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use BigUint;
use One;
use Zero;
/// Counts the number of trailing zeros in the binary representation of a `BigUint`.
///
/// This function calculates the number of consecutive zero bits starting from the least significant bit
/// (rightmost bit) of the given `BigUint` number. It is particularly useful in algorithms that require
/// analysis of a number's binary structure, such as in certain primality tests.
///
/// # Arguments
///
/// * `num` - A reference to a `BigUint` representing the number whose trailing zeros are to be counted.
///
/// # Returns
///
/// The number of trailing zeros in the binary representation of `num`.
///
/// # Examples
///
/// ```
///
/// use num_bigint::BigUint;
/// use large_primes::utils::get_trailing_zeros;
///
/// let number = BigUint::from(8u32); // Binary: 1000
/// let trailing_zeros = get_trailing_zeros(&number);
/// assert_eq!(trailing_zeros, BigUint::from(3u32)); // Three trailing zeros
/// ```