Class MathExtensions
Extension methods for certain math operations.
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.Double> | source | A sequence of double values to determine the maximum value of. |
Returns
Type | Description |
---|---|
System.Double | 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.Nullable<System.Double>> | source | A sequence of nullable double values to determine the maximum value of. |
Returns
Type | Description |
---|---|
System.Nullable<System.Double> | 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.Nullable<Single>> | source | A sequence of nullable float values to determine the maximum value of. |
Returns
Type | Description |
---|---|
System.Nullable<Single> | 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<Single> | source | A sequence of float values to determine the maximum value of. |
Returns
Type | Description |
---|---|
Single | 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.Double> | source | A sequence of double values to determine the minimum value of. |
Returns
Type | Description |
---|---|
System.Double | 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.Nullable<System.Double>> | source | A sequence of nullable double values to determine the minimum value of. |
Returns
Type | Description |
---|---|
System.Nullable<System.Double> | 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.Nullable<Single>> | source | A sequence of nullable float values to determine the minimum value of. |
Returns
Type | Description |
---|---|
System.Nullable<Single> | 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<Single> | source | A sequence of float values to determine the minimum value of. |
Returns
Type | Description |
---|---|
Single | 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.