Class MathExtensions
Inherited Members
Namespace: System
Assembly: Acoustics.Shared.dll
Syntax
public static class MathExtensions
Methods
| Improve this Doc View SourceClamp(Byte, Byte, Byte)
Restricts a Byte to be within a specified range.
Declaration
public static byte Clamp(this byte value, byte min, byte max)
Parameters
Type | Name | Description |
---|---|---|
Byte | value | The The value to clamp. |
Byte | min | The minimum value. If value is less than min, min will be returned. |
Byte | max | The maximum value. If value is greater than max, max will be returned. |
Returns
Type | Description |
---|---|
Byte | The Byte representing the clamped value. |
Clamp(Double, Double, Double)
Restricts a Double to be within a specified range.
Declaration
public static double Clamp(this double value, double min, double max)
Parameters
Type | Name | Description |
---|---|---|
Double | value | The The value to clamp. |
Double | min | The minimum value. If value is less than min, min will be returned. |
Double | max | The maximum value. If value is greater than max, max will be returned. |
Returns
Type | Description |
---|---|
Double | The Double representing the clamped value. |
Clamp(Int32, Int32, Int32)
Restricts a Int32 to be within a specified range.
Declaration
public static int Clamp(this int value, int min, int max)
Parameters
Type | Name | Description |
---|---|---|
Int32 | value | The The value to clamp. |
Int32 | min | The minimum value. If value is less than min, min will be returned. |
Int32 | max | The maximum value. If value is greater than max, max will be returned. |
Returns
Type | Description |
---|---|
Int32 | The Int32 representing the clamped value. |
Clamp(Single, Single, Single)
Restricts a Single to be within a specified range.
Declaration
public static float Clamp(this float value, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
Single | value | The The value to clamp. |
Single | min | The minimum value. If value is less than min, min will be returned. |
Single | max | The maximum value. If value is greater than max, max will be returned. |
Returns
Type | Description |
---|---|
Single | The Single representing the clamped value. |
Clamp(UInt32, UInt32, UInt32)
Restricts a UInt32 to be within a specified range.
Declaration
public static uint Clamp(this uint value, uint min, uint max)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | value | The The value to clamp. |
UInt32 | min | The minimum value. If value is less than min, min will be returned. |
UInt32 | max | The maximum value. If value is greater than max, max will be returned. |
Returns
Type | Description |
---|---|
UInt32 | The Int32 representing the clamped value. |
Max<T>(T[])
Declaration
public static T Max<T>(params T[] values)
Parameters
Type | Name | Description |
---|---|---|
T[] | values |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Min<T>(T[])
Declaration
public static T Min<T>(params T[] values)
Parameters
Type | Name | Description |
---|---|---|
T[] | values |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |