Class DoubleExtensions
Provides extension methods for double
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 |
|---|---|---|
| double | value1 | The first double. |
| double | value2 | The other double. |
Returns
| Type | Description |
|---|---|
| bool |
|
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 |
|---|---|---|
| double | value1 | The first double. |
| double | value2 | The other double. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Closeness is checked by using an epsilon of 1.53E-06
IsClose(double, double)
Determines whether a double is close to another.
Declaration
public static bool IsClose(this double value1, double value2)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value1 | The first double. |
| double | value2 | The other double. |
Returns
| Type | Description |
|---|---|
| bool |
|
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 |
|---|---|---|
| double | value | The value to check. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Finite means the value is not NaN, not NegativeInfinity and not 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 |
|---|---|---|
| double | value1 | The first double. |
| double | value2 | The other double. |
Returns
| Type | Description |
|---|---|
| bool |
|
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 |
|---|---|---|
| double | value1 | The first double. |
| double | value2 | The other double. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Closeness is checked by using an epsilon of 1.53E-06