Math.Clamp Metod

Definition

Överlagringar

Name Description
Clamp(UInt64, UInt64, UInt64)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(UInt32, UInt32, UInt32)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(UInt16, UInt16, UInt16)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(Single, Single, Single)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(SByte, SByte, SByte)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(Int32, Int32, Int32)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(Int16, Int16, Int16)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(Double, Double, Double)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(Decimal, Decimal, Decimal)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(Byte, Byte, Byte)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(Int64, Int64, Int64)

Returnerar value fastklämd till det inkluderande intervallet för min och max.

Clamp(UInt64, UInt64, UInt64)

Viktigt!

Detta API uppfyller inte CLS.

Returnerar value fastklämd till det inkluderande intervallet för min och 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);
[<System.CLSCompliant(false)>]
static member Clamp : uint64 * uint64 * uint64 -> uint64
Public Shared Function Clamp (value As ULong, min As ULong, max As ULong) As ULong

Parametrar

value
UInt64

Värdet som ska begränsas.

min
UInt64

Resultatets nedre gräns.

max
UInt64

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Attribut

Undantag

max är mindre än min.

Gäller för

Clamp(UInt32, UInt32, UInt32)

Viktigt!

Detta API uppfyller inte CLS.

Returnerar value fastklämd till det inkluderande intervallet för min och 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);
[<System.CLSCompliant(false)>]
static member Clamp : uint32 * uint32 * uint32 -> uint32
Public Shared Function Clamp (value As UInteger, min As UInteger, max As UInteger) As UInteger

Parametrar

value
UInt32

Värdet som ska begränsas.

min
UInt32

Resultatets nedre gräns.

max
UInt32

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Attribut

Undantag

max är mindre än min.

Gäller för

Clamp(UInt16, UInt16, UInt16)

Viktigt!

Detta API uppfyller inte CLS.

Returnerar value fastklämd till det inkluderande intervallet för min och 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);
[<System.CLSCompliant(false)>]
static member Clamp : uint16 * uint16 * uint16 -> uint16
Public Shared Function Clamp (value As UShort, min As UShort, max As UShort) As UShort

Parametrar

value
UInt16

Värdet som ska begränsas.

min
UInt16

Resultatets nedre gräns.

max
UInt16

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Attribut

Undantag

max är mindre än min.

Gäller för

Clamp(Single, Single, Single)

Returnerar value fastklämd till det inkluderande intervallet för min och 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

Parametrar

value
Single

Värdet som ska begränsas.

min
Single

Resultatets nedre gräns.

max
Single

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

-eller-

NaN om value är lika med NaN.

Undantag

max är mindre än min.

Gäller för

Clamp(SByte, SByte, SByte)

Viktigt!

Detta API uppfyller inte CLS.

Returnerar value fastklämd till det inkluderande intervallet för min och 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);
[<System.CLSCompliant(false)>]
static member Clamp : sbyte * sbyte * sbyte -> sbyte
Public Shared Function Clamp (value As SByte, min As SByte, max As SByte) As SByte

Parametrar

value
SByte

Värdet som ska begränsas.

min
SByte

Resultatets nedre gräns.

max
SByte

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Attribut

Undantag

max är mindre än min.

Gäller för

Clamp(Int32, Int32, Int32)

Returnerar value fastklämd till det inkluderande intervallet för min och 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

Parametrar

value
Int32

Värdet som ska begränsas.

min
Int32

Resultatets nedre gräns.

max
Int32

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Undantag

max är mindre än min.

Gäller för

Clamp(Int16, Int16, Int16)

Returnerar value fastklämd till det inkluderande intervallet för min och 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

Parametrar

value
Int16

Värdet som ska begränsas.

min
Int16

Resultatets nedre gräns.

max
Int16

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Undantag

max är mindre än min.

Gäller för

Clamp(Double, Double, Double)

Returnerar value fastklämd till det inkluderande intervallet för min och 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

Parametrar

value
Double

Värdet som ska begränsas.

min
Double

Resultatets nedre gräns.

max
Double

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

-eller-

NaN om value är lika med NaN.

Undantag

max är mindre än min.

Gäller för

Clamp(Decimal, Decimal, Decimal)

Returnerar value fastklämd till det inkluderande intervallet för min och 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

Parametrar

value
Decimal

Värdet som ska begränsas.

min
Decimal

Resultatets nedre gräns.

max
Decimal

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Undantag

max är mindre än min.

Gäller för

Clamp(Byte, Byte, Byte)

Returnerar value fastklämd till det inkluderande intervallet för min och 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

Parametrar

value
Byte

Värdet som ska begränsas.

min
Byte

Resultatets nedre gräns.

max
Byte

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Undantag

max är mindre än min.

Gäller för

Clamp(Int64, Int64, Int64)

Returnerar value fastklämd till det inkluderande intervallet för min och 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

Parametrar

value
Int64

Värdet som ska begränsas.

min
Int64

Resultatets nedre gräns.

max
Int64

Resultatets övre gräns.

Returer

value om minvaluemax.

-eller-

min om value<min.

-eller-

max om max<value.

Undantag

max är mindre än min.

Gäller för