Math.Clamp Método
Definição
Sobrecargas
| Clamp(UInt64, UInt64, UInt64) |
Retorna |
| Clamp(UInt32, UInt32, UInt32) |
Retorna |
| Clamp(UInt16, UInt16, UInt16) |
Retorna |
| Clamp(Single, Single, Single) |
Retorna |
| Clamp(SByte, SByte, SByte) |
Retorna |
| Clamp(Int32, Int32, Int32) |
Retorna |
| Clamp(Int16, Int16, Int16) |
Retorna |
| Clamp(Double, Double, Double) |
Retorna |
| Clamp(Decimal, Decimal, Decimal) |
Retorna |
| Clamp(Byte, Byte, Byte) |
Retorna |
| Clamp(Int64, Int64, Int64) |
Retorna |
Clamp(UInt64, UInt64, UInt64)
Importante
Esta API não está em conformidade com CLS.
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static System::UInt64 Clamp(System::UInt64 value, System::UInt64 min, System::UInt64 max);
[System.CLSCompliant(false)]
public static ulong Clamp (ulong value, ulong min, ulong max);
public static ulong Clamp (ulong value, ulong min, ulong max);
[<System.CLSCompliant(false)>]
static member Clamp : uint64 * uint64 * uint64 -> uint64
static member Clamp : uint64 * uint64 * uint64 -> uint64
Public Shared Function Clamp (value As ULong, min As ULong, max As ULong) As ULong
Parâmetros
- value
- UInt64
O valor a ser fixado.The value to be clamped.
- min
- UInt64
O limite inferior do resultado.The lower bound of the result.
- max
- UInt64
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
- Atributos
Aplica-se a
Clamp(UInt32, UInt32, UInt32)
Importante
Esta API não está em conformidade com CLS.
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static System::UInt32 Clamp(System::UInt32 value, System::UInt32 min, System::UInt32 max);
[System.CLSCompliant(false)]
public static uint Clamp (uint value, uint min, uint max);
public static uint Clamp (uint value, uint min, uint max);
[<System.CLSCompliant(false)>]
static member Clamp : uint32 * uint32 * uint32 -> uint32
static member Clamp : uint32 * uint32 * uint32 -> uint32
Public Shared Function Clamp (value As UInteger, min As UInteger, max As UInteger) As UInteger
Parâmetros
- value
- UInt32
O valor a ser fixado.The value to be clamped.
- min
- UInt32
O limite inferior do resultado.The lower bound of the result.
- max
- UInt32
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
- Atributos
Aplica-se a
Clamp(UInt16, UInt16, UInt16)
Importante
Esta API não está em conformidade com CLS.
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static System::UInt16 Clamp(System::UInt16 value, System::UInt16 min, System::UInt16 max);
[System.CLSCompliant(false)]
public static ushort Clamp (ushort value, ushort min, ushort max);
public static ushort Clamp (ushort value, ushort min, ushort max);
[<System.CLSCompliant(false)>]
static member Clamp : uint16 * uint16 * uint16 -> uint16
static member Clamp : uint16 * uint16 * uint16 -> uint16
Public Shared Function Clamp (value As UShort, min As UShort, max As UShort) As UShort
Parâmetros
- value
- UInt16
O valor a ser fixado.The value to be clamped.
- min
- UInt16
O limite inferior do resultado.The lower bound of the result.
- max
- UInt16
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
- Atributos
Aplica-se a
Clamp(Single, Single, Single)
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static float Clamp(float value, float min, float max);
public static float Clamp (float value, float min, float max);
static member Clamp : single * single * single -> single
Public Shared Function Clamp (value As Single, min As Single, max As Single) As Single
Parâmetros
- value
- Single
O valor a ser fixado.The value to be clamped.
- min
- Single
O limite inferior do resultado.The lower bound of the result.
- max
- Single
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
- ou --or-
NaN se value for igual a NaN.NaN if value equals NaN.
Aplica-se a
Clamp(SByte, SByte, SByte)
Importante
Esta API não está em conformidade com CLS.
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static System::SByte Clamp(System::SByte value, System::SByte min, System::SByte max);
[System.CLSCompliant(false)]
public static sbyte Clamp (sbyte value, sbyte min, sbyte max);
public static sbyte Clamp (sbyte value, sbyte min, sbyte max);
[<System.CLSCompliant(false)>]
static member Clamp : sbyte * sbyte * sbyte -> sbyte
static member Clamp : sbyte * sbyte * sbyte -> sbyte
Public Shared Function Clamp (value As SByte, min As SByte, max As SByte) As SByte
Parâmetros
- value
- SByte
O valor a ser fixado.The value to be clamped.
- min
- SByte
O limite inferior do resultado.The lower bound of the result.
- max
- SByte
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
- Atributos
Aplica-se a
Clamp(Int32, Int32, Int32)
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static int Clamp(int value, int min, int max);
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
Parâmetros
- value
- Int32
O valor a ser fixado.The value to be clamped.
- min
- Int32
O limite inferior do resultado.The lower bound of the result.
- max
- Int32
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
Aplica-se a
Clamp(Int16, Int16, Int16)
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static short Clamp(short value, short min, short max);
public static short Clamp (short value, short min, short max);
static member Clamp : int16 * int16 * int16 -> int16
Public Shared Function Clamp (value As Short, min As Short, max As Short) As Short
Parâmetros
- value
- Int16
O valor a ser fixado.The value to be clamped.
- min
- Int16
O limite inferior do resultado.The lower bound of the result.
- max
- Int16
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
Aplica-se a
Clamp(Double, Double, Double)
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static double Clamp(double value, double min, double max);
public static double Clamp (double value, double min, double max);
static member Clamp : double * double * double -> double
Public Shared Function Clamp (value As Double, min As Double, max As Double) As Double
Parâmetros
- value
- Double
O valor a ser fixado.The value to be clamped.
- min
- Double
O limite inferior do resultado.The lower bound of the result.
- max
- Double
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
- ou --or-
NaN se value for igual a NaN.NaN if value equals NaN.
Aplica-se a
Clamp(Decimal, Decimal, Decimal)
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static System::Decimal Clamp(System::Decimal value, System::Decimal min, System::Decimal max);
public static decimal Clamp (decimal value, decimal min, decimal max);
static member Clamp : decimal * decimal * decimal -> decimal
Public Shared Function Clamp (value As Decimal, min As Decimal, max As Decimal) As Decimal
Parâmetros
- value
- Decimal
O valor a ser fixado.The value to be clamped.
- min
- Decimal
O limite inferior do resultado.The lower bound of the result.
- max
- Decimal
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value <min.min if value <min.
- ou --or-
max se max < value.max if max < value.
Aplica-se a
Clamp(Byte, Byte, Byte)
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static System::Byte Clamp(System::Byte value, System::Byte min, System::Byte max);
public static byte Clamp (byte value, byte min, byte max);
static member Clamp : byte * byte * byte -> byte
Public Shared Function Clamp (value As Byte, min As Byte, max As Byte) As Byte
Parâmetros
- value
- Byte
O valor a ser fixado.The value to be clamped.
- min
- Byte
O limite inferior do resultado.The lower bound of the result.
- max
- Byte
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.
Aplica-se a
Clamp(Int64, Int64, Int64)
Retorna value fixado no intervalo inclusivo de min e max.Returns value clamped to the inclusive range of min and max.
public:
static long Clamp(long value, long min, long max);
public static long Clamp (long value, long min, long max);
static member Clamp : int64 * int64 * int64 -> int64
Public Shared Function Clamp (value As Long, min As Long, max As Long) As Long
Parâmetros
- value
- Int64
O valor a ser fixado.The value to be clamped.
- min
- Int64
O limite inferior do resultado.The lower bound of the result.
- max
- Int64
O limite superior do resultado.The upper bound of the result.
Retornos
value se min ≤ value ≤ max.value if min ≤ value ≤ max.
- ou --or-
min se value < min.min if value < min.
- ou --or-
max se max < value.max if max < value.