Mojo function
max
max(x: Int, y: Int, /) -> Int
Gets the maximum of two integers.
Args:
Returns:
Int
: Maximum of x and y.
max(x: UInt, y: UInt, /) -> UInt
Gets the maximum of two integers.
Args:
Returns:
UInt
: Maximum of x and y.
max[dtype: DType, //](x: SIMD[dtype, size], y: SIMD[dtype, size], /) -> SIMD[dtype, size]
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.
Constraints:
The type of the inputs must be numeric or boolean.
Parameters:
- dtype (
DType
): The data type of the SIMD vector.
Args:
Returns:
SIMD
: A SIMD vector containing the elementwise maximum of x and y.
max[T: Copyable & GreaterThanComparable](x: T, *ys: T) -> T
Gets the maximum value from a sequence of values.
Parameters:
- T (
Copyable
&GreaterThanComparable
): A type that is both copyable and comparable with greater than.
Args:
- x (
T
): The first value to compare. - *ys (
T
): Zero or more additional values to compare.
Returns:
T
: The maximum value from the input sequence.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!