Skip to main content

function

max

max(x: Int, y: Int) -> Int

Gets the maximum of two integers.

Args:

  • x (Int): Integer input to max.
  • y (Int): Integer input to max.

Returns:

Maximum of x and y.

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

Performs elementwise maximum of x and y.

An element of the result SIMD vector will be the maximum of the corresponding elements in x and y.

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]): First SIMD vector.
  • y (SIMD[type, simd_width]): Second SIMD vector.

Returns:

A SIMD vector containing the elementwise maximum of x and y.