Skip to main content

function

round

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

Performs elementwise rounding on the elements of a SIMD vector.

This rounding goes to the nearest integer with ties away from zero.

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 rounding of x.