Vector128.Clamp<T> Method

Definition

Restricts a vector between a minimum and a maximum value.

C#
public static System.Runtime.Intrinsics.Vector128<T> Clamp<T>(System.Runtime.Intrinsics.Vector128<T> value, System.Runtime.Intrinsics.Vector128<T> min, System.Runtime.Intrinsics.Vector128<T> max);

Type Parameters

T

Parameters

value
Vector128<T>

The vector to restrict.

min
Vector128<T>

The minimum value.

max
Vector128<T>

The maximum value.

Returns

The restricted vector.

Exceptions

The type of the elements in the vector (T) is not supported.

Applies to

Product Versions
.NET 9