--- layout: stdlib-reference --- # min ## Description Minimum. ## Signature
/// Requires Capability Set 1:
T min<T>(
    T x,
    T y)
    where T : __BuiltinIntegerType;

/// Requires Capability Set 1:
vector<T, N> min<T, int N>(
    vector<T, N> x,
    vector<T, N> y)
    where T : __BuiltinIntegerType;

/// Requires Capability Set 1:
matrix<T, N, M> min<T, int N, int M>(
    matrix<T, N, M> x,
    matrix<T, N, M> y)
    where T : __BuiltinIntegerType;

/// Requires Capability Set 1:
T min<T>(
    T x,
    T y)
    where T : __BuiltinFloatingPointType;

/// Requires Capability Set 1:
vector<T, N> min<T, int N>(
    vector<T, N> x,
    vector<T, N> y)
    where T : __BuiltinFloatingPointType;

/// Requires Capability Set 1:
matrix<T, N, M> min<T, int N, int M>(
    matrix<T, N, M> x,
    matrix<T, N, M> y)
    where T : __BuiltinFloatingPointType;

/// Requires Capability Set 1:
T min<T>(
    T x,
    T y)
    where T : IComparable;

/// Requires Capability Set 2:
CoopVec<T, N> min<T, int N>(
    CoopVec<T, N> x,
    CoopVec<T, N> y)
    where T : __BuiltinFloatingPointType;

/// Requires Capability Set 3:
CoopVec<T, N> min<T, int N>(
    CoopVec<T, N> x,
    CoopVec<T, N> y)
    where T : __BuiltinIntegerType;

## Generic Parameters #### T: [\_\_BuiltinIntegerType](../interfaces/0_builtinintegertype-029g/index.html) #### N : int #### M : int #### T: [\_\_BuiltinFloatingPointType](../interfaces/0_builtinfloatingpointtype-029hm/index.html) #### T: [IComparable](../interfaces/icomparable-01/index.html) ## Parameters #### x : [T](min.html#typeparam-T) The first value to compare. #### y : [T](min.html#typeparam-T) The second value to compare. #### x : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> The first value to compare. #### y : [vector](../types/vector/index.html)\<[T](../types/vector/index.html#typeparam-T), [N](../types/vector/index.html#decl-N)\> The second value to compare. #### x : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> The first value to compare. #### y : [matrix](../types/matrix/index.html)\<[T](../types/matrix/t-0.html), [N](../types/matrix/index.html#decl-N), [M](../types/matrix/index.html#decl-M)\> The second value to compare. #### x : [CoopVec](../types/coopvec-04/index.html)\<[T](../types/coopvec-04/index.html#typeparam-T), [N](../types/coopvec-04/index.html#decl-N)\> The first value to compare. #### y : [CoopVec](../types/coopvec-04/index.html)\<[T](../types/coopvec-04/index.html#typeparam-T), [N](../types/coopvec-04/index.html#decl-N)\> The second value to compare. ## Return value The smaller of the two values, element-wise if vector typed. ## Remarks For HLSL, GLSL, and metal targets, this is implemented with the min() intrinsic. For SPIR-V, it is implemented with the UMin or SMin instruction, depending on the signedness of the type. ## Availability and Requirements ### Capability Set 1 Defined for the following targets: #### hlsl Available in all stages. #### glsl Available in all stages. #### cpp Available in all stages. #### cuda Available in all stages. #### metal Available in all stages. #### wgsl Available in all stages. #### spirv Available in all stages. #### llvm Available in all stages. ### Capability Set 2 Defined for the following targets: #### hlsl Available in all stages. #### glsl Available in all stages. #### cpp Available in all stages. #### cuda Available in all stages. Requires capability: `optix_coopvec`. #### spirv Available in all stages. Requires capability: `spvCooperativeVectorNV`. ### Capability Set 3 Defined for the following targets: #### hlsl Available in all stages. #### glsl Available in all stages. #### cpp Available in all stages. #### cuda Available in all stages. #### spirv Available in all stages. Requires capability: `spvCooperativeVectorNV`.