Class MathExtensions
Extension methods for certain math operations.
Inheritance
Namespace: Microsoft.Psi
Assembly: Microsoft.Psi.dll
Syntax
public static class MathExtensions : object
Methods
View SourceMax(IEnumerable<Double>)
Returns the maximum value in a sequence of double values.
Declaration
public static double Max(IEnumerable<double> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of double values to determine the maximum value of. |
Returns
Type | Description |
---|---|
System. |
The maximum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a maximum value of NaN. An empty sequence will throw an InvalidOperationException.
Max(IEnumerable<Nullable<Double>>)
Returns the maximum value in a sequence of nullable double values.
Declaration
public static double? Max(IEnumerable<double?> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of nullable double values to determine the maximum value of. |
Returns
Type | Description |
---|---|
System. |
The maximum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a maximum value of NaN. Null values in the sequence are ignored. An empty sequence will return null.
Max(IEnumerable<Nullable<Single>>)
Returns the maximum value in a sequence of nullable float values.
Declaration
public static float? Max(IEnumerable<float?> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of nullable float values to determine the maximum value of. |
Returns
Type | Description |
---|---|
System. |
The maximum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a maximum value of NaN. Null values in the sequence are ignored. An empty sequence will return null.
Max(IEnumerable<Single>)
Returns the maximum value in a sequence of float values.
Declaration
public static float Max(IEnumerable<float> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of float values to determine the maximum value of. |
Returns
Type | Description |
---|---|
System. |
The maximum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a maximum value of NaN. An empty sequence will throw an InvalidOperationException.
Min(IEnumerable<Double>)
Returns the minimum value in a sequence of double values.
Declaration
public static double Min(IEnumerable<double> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of double values to determine the minimum value of. |
Returns
Type | Description |
---|---|
System. |
The minimum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a minimum value of NaN. An empty sequence will throw an InvalidOperationException.
Min(IEnumerable<Nullable<Double>>)
Returns the minimum value in a sequence of nullable double values.
Declaration
public static double? Min(IEnumerable<double?> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of nullable double values to determine the minimum value of. |
Returns
Type | Description |
---|---|
System. |
The minimum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a minimum value of NaN. Null values in the sequence are ignored. An empty sequence will return null.
Min(IEnumerable<Nullable<Single>>)
Returns the minimum value in a sequence of nullable float values.
Declaration
public static float? Min(IEnumerable<float?> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of nullable float values to determine the minimum value of. |
Returns
Type | Description |
---|---|
System. |
The minimum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a minimum value of NaN. Null values in the sequence are ignored. An empty sequence will return null.
Min(IEnumerable<Single>)
Returns the minimum value in a sequence of float values.
Declaration
public static float Min(IEnumerable<float> source)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System. |
source | A sequence of float values to determine the minimum value of. |
Returns
Type | Description |
---|---|
System. |
The minimum value in the sequence. |
Remarks
A sequence containing one or more NaN values will return a minimum value of NaN. An empty sequence will throw an InvalidOperationException.