语言

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 的非独占最大值。

返回

固定 value 到非独占范围 min 和 max.

实现

适用于