Классы | Открытые статические члены

Класс TSLab.Utils.DoubleUtil

Полный список членов класса

Классы

struct  NanUnion

Открытые статические члены

static bool AreClose (double value1, double value2)
 AreClose - Returns whether or not two doubles are "close". That is, whether or not they are within epsilon of each other. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
static bool LessThan (double value1, double value2)
 LessThan - Returns whether or not the first double is less than the second double. That is, whether or not the first is strictly less than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
static bool GreaterThan (double value1, double value2)
 GreaterThan - Returns whether or not the first double is greater than the second double. That is, whether or not the first is strictly greater than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
static bool LessThanOrClose (double value1, double value2)
 LessThanOrClose - Returns whether or not the first double is less than or close to the second double. That is, whether or not the first is strictly less than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
static bool GreaterThanOrClose (double value1, double value2)
 GreaterThanOrClose - Returns whether or not the first double is greater than or close to the second double. That is, whether or not the first is strictly greater than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
static bool IsZero (double value)
 IsZero - Returns whether or not the double is "close" to 0. Same as AreClose(double, 0), but this is faster.
static bool IsZero (double?value)
static bool IsOne (double value)
 IsOne - Returns whether or not the double is "close" to 1. Same as AreClose(double, 1), but this is faster.
static double Round (double value, double precesion)
static bool IsNaN (double value)

Методы

static bool TSLab.Utils.DoubleUtil.AreClose ( double  value1,
double  value2 
) [static]

AreClose - Returns whether or not two doubles are "close". That is, whether or not they are within epsilon of each other. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

Возвращает:
bool - the result of the AreClose comparision.
Аргументы:
value1 The first double to compare.
value2 The second double to compare.
static bool TSLab.Utils.DoubleUtil.GreaterThan ( double  value1,
double  value2 
) [static]

GreaterThan - Returns whether or not the first double is greater than the second double. That is, whether or not the first is strictly greater than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

Возвращает:
bool - the result of the GreaterThan comparision.
Аргументы:
value1 The first double to compare.
value2 The second double to compare.
static bool TSLab.Utils.DoubleUtil.GreaterThanOrClose ( double  value1,
double  value2 
) [static]

GreaterThanOrClose - Returns whether or not the first double is greater than or close to the second double. That is, whether or not the first is strictly greater than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

Возвращает:
bool - the result of the GreaterThanOrClose comparision.
Аргументы:
value1 The first double to compare.
value2 The second double to compare.
static bool TSLab.Utils.DoubleUtil.IsOne ( double  value  )  [static]

IsOne - Returns whether or not the double is "close" to 1. Same as AreClose(double, 1), but this is faster.

Возвращает:
bool - the result of the AreClose comparision.
Аргументы:
value The double to compare to 1.
static bool TSLab.Utils.DoubleUtil.IsZero ( double  value  )  [static]

IsZero - Returns whether or not the double is "close" to 0. Same as AreClose(double, 0), but this is faster.

Возвращает:
bool - the result of the AreClose comparision.
Аргументы:
value The double to compare to 0.
static bool TSLab.Utils.DoubleUtil.LessThan ( double  value1,
double  value2 
) [static]

LessThan - Returns whether or not the first double is less than the second double. That is, whether or not the first is strictly less than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

Возвращает:
bool - the result of the LessThan comparision.
Аргументы:
value1 The first double to compare.
value2 The second double to compare.
static bool TSLab.Utils.DoubleUtil.LessThanOrClose ( double  value1,
double  value2 
) [static]

LessThanOrClose - Returns whether or not the first double is less than or close to the second double. That is, whether or not the first is strictly less than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

Возвращает:
bool - the result of the LessThanOrClose comparision.
Аргументы:
value1 The first double to compare.
value2 The second double to compare.