Class DoubleExtensions
Provides extension methods for System.Double
Inheritance
Namespace: Sartorius.SAF.Extensions
Assembly: Sartorius.SAF.dll
Syntax
public static class DoubleExtensions
Remarks
Closeness is checked by using an epsilon of 1.53E-06
Methods
View SourceGreaterThan(Double, Double)
Determines whether a value is greater than the other and not close (see IsClose(Double, Double)).
Declaration
public static bool GreaterThan(this double value1, double value2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value1 | The first System.Double. |
System.Double | value2 | The other System.Double. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Closeness is checked by using an epsilon of 1.53E-06
GreaterThanOrClose(Double, Double)
Determines whether a value is greater than another or close to it.
Declaration
public static bool GreaterThanOrClose(this double value1, double value2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value1 | The first System.Double. |
System.Double | value2 | The other System.Double. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Closeness is checked by using an epsilon of 1.53E-06
IsClose(Double, Double)
Determines whether a System.Double is close to another.
Declaration
public static bool IsClose(this double value1, double value2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value1 | The first System.Double. |
System.Double | value2 | The other System.Double. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Closeness is checked by using an epsilon of 1.53E-06
IsFinite(Double)
Determines whether a value is finite
Declaration
public static bool IsFinite(this double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value to check. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Finite means the value is not System.Double.NaN, not System.Double.NegativeInfinity and not System.Double.PositiveInfinity.
LessThan(Double, Double)
Determines whether a value is less than the other and not close (see IsClose(Double, Double)).
Declaration
public static bool LessThan(this double value1, double value2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value1 | The first System.Double. |
System.Double | value2 | The other System.Double. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Closeness is checked by using an epsilon of 1.53E-06
LessThanOrClose(Double, Double)
Determines whether a value is less than another or close to it.
Declaration
public static bool LessThanOrClose(this double value1, double value2)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value1 | The first System.Double. |
System.Double | value2 | The other System.Double. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Closeness is checked by using an epsilon of 1.53E-06