Method Clamp
- Namespace
- Zyl.VectorTraits
- Assembly
- VectorTraits.dll
Clamp(sbyte, sbyte, sbyte)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
[CLSCompliant(false)]
public static sbyte Clamp(sbyte value, sbyte amin, sbyte amax)
Parameters
value
sbyteThe value to be clamped (要限制的值).
amin
sbyteThe lower bound of the result (结果的下限).
amax
sbyteThe upper bound of the result (结果的上限).
Returns
- sbyte
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(byte, byte, byte)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static byte Clamp(byte value, byte amin, byte amax)
Parameters
value
byteThe value to be clamped (要限制的值).
amin
byteThe lower bound of the result (结果的下限).
amax
byteThe upper bound of the result (结果的上限).
Returns
- byte
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(short, short, short)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static short Clamp(short value, short amin, short amax)
Parameters
value
shortThe value to be clamped (要限制的值).
amin
shortThe lower bound of the result (结果的下限).
amax
shortThe upper bound of the result (结果的上限).
Returns
- short
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(ushort, ushort, ushort)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
[CLSCompliant(false)]
public static ushort Clamp(ushort value, ushort amin, ushort amax)
Parameters
value
ushortThe value to be clamped (要限制的值).
amin
ushortThe lower bound of the result (结果的下限).
amax
ushortThe upper bound of the result (结果的上限).
Returns
- ushort
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(int, int, int)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static int Clamp(int value, int amin, int amax)
Parameters
value
intThe value to be clamped (要限制的值).
amin
intThe lower bound of the result (结果的下限).
amax
intThe upper bound of the result (结果的上限).
Returns
- int
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(uint, uint, uint)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
[CLSCompliant(false)]
public static uint Clamp(uint value, uint amin, uint amax)
Parameters
value
uintThe value to be clamped (要限制的值).
amin
uintThe lower bound of the result (结果的下限).
amax
uintThe upper bound of the result (结果的上限).
Returns
- uint
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(long, long, long)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static long Clamp(long value, long amin, long amax)
Parameters
value
longThe value to be clamped (要限制的值).
amin
longThe lower bound of the result (结果的下限).
amax
longThe upper bound of the result (结果的上限).
Returns
- long
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(ulong, ulong, ulong)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
[CLSCompliant(false)]
public static ulong Clamp(ulong value, ulong amin, ulong amax)
Parameters
value
ulongThe value to be clamped (要限制的值).
amin
ulongThe lower bound of the result (结果的下限).
amax
ulongThe upper bound of the result (结果的上限).
Returns
- ulong
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(nint, nint, nint)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static nint Clamp(nint value, nint amin, nint amax)
Parameters
value
nintThe value to be clamped (要限制的值).
amin
nintThe lower bound of the result (结果的下限).
amax
nintThe upper bound of the result (结果的上限).
Returns
- nint
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(nuint, nuint, nuint)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
[CLSCompliant(false)]
public static nuint Clamp(nuint value, nuint amin, nuint amax)
Parameters
value
nuintThe value to be clamped (要限制的值).
amin
nuintThe lower bound of the result (结果的下限).
amax
nuintThe upper bound of the result (结果的上限).
Returns
- nuint
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(float, float, float)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static float Clamp(float value, float amin, float amax)
Parameters
value
floatThe value to be clamped (要限制的值).
amin
floatThe lower bound of the result (结果的下限).
amax
floatThe upper bound of the result (结果的上限).
Returns
- float
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(double, double, double)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static double Clamp(double value, double amin, double amax)
Parameters
value
doubleThe value to be clamped (要限制的值).
amin
doubleThe lower bound of the result (结果的下限).
amax
doubleThe upper bound of the result (结果的上限).
Returns
- double
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also
Clamp(Half, Half, Half)
Returns value
clamped to the inclusive range of amin
and amax
(返回限制在 amin
和 amax
范围内的 value
).
public static Half Clamp(Half value, Half amin, Half amax)
Parameters
value
HalfThe value to be clamped (要限制的值).
amin
HalfThe lower bound of the result (结果的下限).
amax
HalfThe upper bound of the result (结果的上限).
Returns
- Half
Returns
(value<amax)?( (value>amin)?value:amin ):amax
.
- See Also