Skip to main content
Log in

Mojo function

min

min(x: Int, y: Int, /) -> Int

Gets the minimum of two integers.

Args:

  • ​x (Int): Integer input to min.
  • ​y (Int): Integer input to min.

Returns:

Minimum of x and y.

min(x: UInt, y: UInt, /) -> UInt

Gets the minimum of two integers.

Args:

  • ​x (UInt): Integer input to min.
  • ​y (UInt): Integer input to min.

Returns:

Minimum of x and y.

min(x: SIMD[type, size], y: SIMD[type, size], /) -> SIMD[$0, $1]

Gets the elementwise minimum of x and y.

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

Constraints:

The type of the inputs must be numeric.

Args:

  • ​x (SIMD[type, size]): First SIMD vector.
  • ​y (SIMD[type, size]): Second SIMD vector.

Returns:

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

Was this page helpful?