Mojo function
count_trailing_zeros
count_trailing_zeros(val: Int) -> Int
Counts the number of trailing zeros for an integer.
Args:
- βval (
Int
): The input value.
Returns:
The number of trailing zeros of the input.
count_trailing_zeros[type: DType, width: Int, //](val: SIMD[type, width]) -> SIMD[$0, $1]
Counts the per-element number of trailing zeros in a SIMD vector.
Constraints:
The element type of the input vector must be integral.
Parameters:
- βtype (
DType
):dtype
used for the computation. - βwidth (
Int
): SIMD width used for the computation.
Args:
- βval (
SIMD[type, width]
): The input value.
Returns:
A SIMD value where the element at position i
contains the number of trailing zeros at position i
of the input value.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?