[−][src]Function safe_arch::trailing_zero_count_u32
#[must_use]pub fn trailing_zero_count_u32(a: u32) -> u32
This is supported with target feature
bmi1
only.Counts the number of trailing zero bits in a u32
.
An input of 0 gives 32.
assert_eq!(trailing_zero_count_u32(0b0), 32); assert_eq!(trailing_zero_count_u32(0b1), 0); assert_eq!(trailing_zero_count_u32(0b10), 1); assert_eq!(trailing_zero_count_u32(0b100), 2); assert_eq!(trailing_zero_count_u32(0b111100), 2);