語言

Int32.Clamp(Int32, Int32, Int32) 方法

定義

將值夾在內含最小值和最大值。

public:
 static int Clamp(int value, int min, int max) = System::Numerics::INumber<int>::Clamp;
public static int Clamp(int value, int min, int max);
static member Clamp : int * int * int -> int
Public Shared Function Clamp (value As Integer, min As Integer, max As Integer) As Integer

參數

value
Int32

夾持的價值。

min
Int32

包容性的最低限 value 度應該被夾住。

max
Int32

包容性最大值 value 應該被夾住。

傳回

將 和 的包容範圍 valuemin箝取max後的結果。

實作

適用於