語言

UInt16.Clamp(UInt16, UInt16, UInt16) 方法

定義

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

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

參數

value
UInt16

夾持的價值。

min
UInt16

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

max
UInt16

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

傳回

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

實作

適用於