Skip to main content

function

roundeven

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

Performs elementwise banker's rounding on the elements of a SIMD vector.

This rounding goes to the nearest integer with ties toward the nearest even integer.

Parameters:

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

Args:

  • x (SIMD[type, simd_width]): SIMD vector to perform rounding on.

Returns:

The elementwise banker's rounding of x.