Skip to main content

function

cttz

cttz(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.

cttz[type: DType, simd_width: Int](val: SIMD[type, simd_width]) -> SIMD[$0, $1]

Counts the number of trailing zero for a SIMD vector.

Parameters:

  • type (DType): dtype used for the computation. Constraints: must be integral.
  • simd_width (Int): SIMD width used for the computation.

Args:

  • val (SIMD[type, simd_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.