Skip to main content

function

is_even

is_even(val: Int) -> Bool

Performs elementwise check of whether an integer value is even.

Args:

  • val (Int): The int value to check.

Returns:

True if the input is even and False otherwise.

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

Performs elementwise check of whether SIMD vector contains even values.

An element of the result SIMD vector will be True if the value is even, and False otherwise.

Parameters:

  • type (DType): The dtype of the input SIMD vector.
  • simd_width (Int): The width of the input and output SIMD vector.

Args:

  • val (SIMD[type, simd_width]): The SIMD vector to check.

Returns:

A SIMD vector containing True if the corresponding element in val is even, otherwise False.