## Types in MathNet.Numerics

Type Precision

Namespace MathNet.Numerics

Utilities for working with floating point numbers.

### Public Static Functions

#### boolAlmostEqual(this double a, double b)

Checks whether two real numbers are almost equal.
##### Parameters

The first number

###### `double` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqual(this Complex a, Complex b)

Checks whether two Complex numbers are almost equal.
##### Parameters

The first number

###### `Complex` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqual(this double a, double b, double maximumAbsoluteError)

Compares two doubles and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolAlmostEqual(this double a, double b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.
##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqual(this float a, float b, double maximumAbsoluteError)

Compares two complex and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `float` b

The second value.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolAlmostEqual(this float a, float b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.
##### Parameters

The first value.

###### `float` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqual(this Complex a, Complex b, double maximumAbsoluteError)

Compares two complex and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Complex` b

The second value.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolAlmostEqual(this Complex32 a, Complex32 b, double maximumAbsoluteError)

Compares two complex and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Complex32` b

The second value.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolAlmostEqual(this Complex32 a, Complex32 b)

Checks whether two Complex numbers are almost equal.
##### Parameters

The first number

###### `Complex32` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqual(this float a, float b)

Checks whether two real numbers are almost equal.
##### Parameters

The first number

###### `float` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqual(this Complex32 a, Complex32 b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.
##### Parameters

The first value.

###### `Complex32` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqual(this Complex a, Complex b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.
##### Parameters

The first value.

###### `Complex` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqual<T>(this Vector<T> a, Vector<T> b, double maximumAbsoluteError)

Compares two vectors and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Vector<T>` b

The second value.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolAlmostEqual<T>(this Matrix<T> a, Matrix<T> b, double maximumAbsoluteError)

Compares two matrices and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Matrix<T>` b

The second value.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolAlmostEqual<T>(this Vector<T> a, Vector<T> b, int decimalPlaces)

Compares two vectors and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.
##### Parameters

The first value.

###### `Vector<T>` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqual<T>(this Matrix<T> a, Matrix<T> b, int decimalPlaces)

Compares two matrices and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.
##### Parameters

The first value.

###### `Matrix<T>` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualNorm(this double a, double b, double diff, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.

The values are equal if the difference between the two numbers is smaller than 0.5e-decimalPlaces. We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters
###### `double` a

The norm of the first value (can be negative).

###### `double` b

The norm of the second value (can be negative).

###### `double` diff

The norm of the difference of the two values (can be negative).

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualNorm(this double a, double b, double diff, double maximumAbsoluteError)

Compares two doubles and determines if they are equal within the specified maximum absolute error.
##### Parameters
###### `double` a

The norm of the first value (can be negative).

###### `double` b

The norm of the second value (can be negative).

###### `double` diff

The norm of the difference of the two values (can be negative).

###### `double` maximumAbsoluteError

The absolute accuracy required for being almost equal.

##### Return
###### `bool`

True if both doubles are almost equal up to the specified maximum absolute error, false otherwise.

#### boolAlmostEqualNorm<T>(this T a, T b, double maximumAbsoluteError)

Compares two doubles and determines if they are equal within the specified maximum absolute error.
##### Parameters

The first value.

###### `T` b

The second value.

###### `double` maximumAbsoluteError

The absolute accuracy required for being almost equal.

##### Return
###### `bool`

True if both doubles are almost equal up to the specified maximum absolute error, false otherwise.

#### boolAlmostEqualNorm<T>(this T a, T b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not, using the number of decimal places as an absolute measure.

The values are equal if the difference between the two numbers is smaller than 0.5e-decimalPlaces. We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `T` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualNormRelative(this double a, double b, double diff, double maximumError)

Compares two doubles and determines if they are equal within the specified maximum error.
##### Parameters
###### `double` a

The norm of the first value (can be negative).

###### `double` b

The norm of the second value (can be negative).

###### `double` diff

The norm of the difference of the two values (can be negative).

###### `double` maximumError

The accuracy required for being almost equal.

##### Return
###### `bool`

True if both doubles are almost equal up to the specified maximum error, false otherwise.

#### boolAlmostEqualNormRelative(this double a, double b, double diff, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters
###### `double` a

The norm of the first value (can be negative).

###### `double` b

The norm of the second value (can be negative).

###### `double` diff

The norm of the difference of the two values (can be negative).

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualNormRelative<T>(this T a, T b, double maximumError)

Compares two doubles and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `T` b

The second value.

###### `double` maximumError

The accuracy required for being almost equal.

##### Return
###### `bool`

True if both doubles are almost equal up to the specified maximum error, false otherwise.

#### boolAlmostEqualNormRelative<T>(this T a, T b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `T` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualNumbersBetween(this float a, float b, int maxNumbersBetween)

Compares two floats and determines if they are equal to within the tolerance or not. Equality comparison is based on the binary representation.
##### Parameters

The first value.

###### `float` b

The second value.

###### `int` maxNumbersBetween

The maximum number of floating point values between the two values. Must be 1 or larger.

#### boolAlmostEqualNumbersBetween(this double a, double b, long maxNumbersBetween)

Compares two doubles and determines if they are equal to within the tolerance or not. Equality comparison is based on the binary representation.

Determines the 'number' of floating point numbers between two values (i.e. the number of discrete steps between the two numbers) and then checks if that is within the specified tolerance. So if a tolerance of 1 is passed then the result will be true only if the two numbers have the same binary representation OR if they are two adjacent numbers that only differ by one step.

The comparison method used is explained in http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm. The article at http://www.extremeoptimization.com/resources/Articles/FPDotNetConceptsAndFormats.aspx explains how to transform the C code to .NET enabled code without using pointers and unsafe code.

##### Parameters

The first value.

###### `double` b

The second value.

###### `long` maxNumbersBetween

The maximum number of floating point values between the two values. Must be 1 or larger.

#### boolAlmostEqualRelative(this Complex32 a, Complex32 b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
##### Parameters

The first value.

###### `Complex32` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualRelative(this Complex a, Complex b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
##### Parameters

The first value.

###### `Complex` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualRelative(this double a, double b, double maximumError)

Compares two doubles and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumError

The accuracy required for being almost equal.

#### boolAlmostEqualRelative(this Complex a, Complex b, double maximumError)

Compares two complex and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Complex` b

The second value.

###### `double` maximumError

The accuracy required for being almost equal.

#### boolAlmostEqualRelative(this Complex32 a, Complex32 b, double maximumError)

Compares two complex and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Complex32` b

The second value.

###### `double` maximumError

The accuracy required for being almost equal.

#### boolAlmostEqualRelative(this float a, float b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
##### Parameters

The first value.

###### `float` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualRelative(this double a, double b, int decimalPlaces)

Compares two doubles and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualRelative(this double a, double b)

Checks whether two real numbers are almost equal.
##### Parameters

The first number

###### `double` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqualRelative(this float a, float b)

Checks whether two real numbers are almost equal.
##### Parameters

The first number

###### `float` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqualRelative(this Complex a, Complex b)

Checks whether two Complex numbers are almost equal.
##### Parameters

The first number

###### `Complex` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqualRelative(this float a, float b, double maximumError)

Compares two complex and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `float` b

The second value.

###### `double` maximumError

The accuracy required for being almost equal.

#### boolAlmostEqualRelative(this Complex32 a, Complex32 b)

Checks whether two Complex numbers are almost equal.
##### Parameters

The first number

###### `Complex32` b

The second number

##### Return
###### `bool`

true if the two values differ by no more than 10 * 2^(-52); false otherwise.

#### boolAlmostEqualRelative<T>(this Vector<T> a, Vector<T> b, double maximumError)

Compares two vectors and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Vector<T>` b

The second value.

###### `double` maximumError

The accuracy required for being almost equal.

#### boolAlmostEqualRelative<T>(this Matrix<T> a, Matrix<T> b, int decimalPlaces)

Compares two matrices and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
##### Parameters

The first value.

###### `Matrix<T>` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### boolAlmostEqualRelative<T>(this Matrix<T> a, Matrix<T> b, double maximumError)

Compares two matrices and determines if they are equal within the specified maximum error.
##### Parameters

The first value.

###### `Matrix<T>` b

The second value.

###### `double` maximumError

The accuracy required for being almost equal.

#### boolAlmostEqualRelative<T>(this Vector<T> a, Vector<T> b, int decimalPlaces)

Compares two vectors and determines if they are equal to within the specified number of decimal places or not. If the numbers are very close to zero an absolute difference is compared, otherwise the relative difference is compared.
##### Parameters

The first value.

###### `Vector<T>` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

#### doubleCoerceZero(this double a, long maxNumbersBetween)

Forces small numbers near zero to zero, according to the specified absolute accuracy.
##### Parameters
###### `double` a

The real number to coerce to zero, if it is almost zero.

###### `long` maxNumbersBetween

The maximum count of numbers between the zero and the number a.

##### Return
###### `double`

Zero if | a | is fewer than maxNumbersBetween numbers from zero, a otherwise.

#### doubleCoerceZero(this double a, int maxNumbersBetween)

Forces small numbers near zero to zero, according to the specified absolute accuracy.
##### Parameters
###### `double` a

The real number to coerce to zero, if it is almost zero.

###### `int` maxNumbersBetween

The maximum count of numbers between the zero and the number a.

##### Return
###### `double`

Zero if | a | is fewer than maxNumbersBetween numbers from zero, a otherwise.

#### doubleCoerceZero(this double a, double maximumAbsoluteError)

Forces small numbers near zero to zero, according to the specified absolute accuracy.
##### Parameters
###### `double` a

The real number to coerce to zero, if it is almost zero.

###### `double` maximumAbsoluteError

The absolute threshold for a to consider it as zero.

##### Return
###### `double`

Zero if | a | is smaller than maximumAbsoluteError , a otherwise.

#### doubleCoerceZero(this double a)

Forces small numbers near zero to zero.
##### Parameters
###### `double` a

The real number to coerce to zero, if it is almost zero.

##### Return
###### `double`

Zero if | a | is smaller than 2^(-53) = 1.11e-16, a otherwise.

#### intCompareTo(this double a, double b, double maximumAbsoluteError)

Compares two doubles and determines which double is bigger. a < b -> -1; a ~= b (almost equal according to parameter) -> 0; a > b -> +1.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumAbsoluteError

The absolute accuracy required for being almost equal.

#### intCompareTo(this double a, double b, int decimalPlaces)

Compares two doubles and determines which double is bigger. a < b -> -1; a ~= b (almost equal according to parameter) -> 0; a > b -> +1.
##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places on which the values must be compared. Must be 1 or larger.

#### intCompareToNumbersBetween(this double a, double b, long maxNumbersBetween)

Compares two doubles and determines which double is bigger. a < b -> -1; a ~= b (almost equal according to parameter) -> 0; a > b -> +1.
##### Parameters

The first value.

###### `double` b

The second value.

###### `long` maxNumbersBetween

The maximum error in terms of Units in Last Place ( `ulps` ), i.e. the maximum number of decimals that may be different. Must be 1 or larger.

#### intCompareToRelative(this double a, double b, double maximumError)

Compares two doubles and determines which double is bigger. a < b -> -1; a ~= b (almost equal according to parameter) -> 0; a > b -> +1.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumError

The relative accuracy required for being almost equal.

#### intCompareToRelative(this double a, double b, int decimalPlaces)

Compares two doubles and determines which double is bigger. a < b -> -1; a ~= b (almost equal according to parameter) -> 0; a > b -> +1.
##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places on which the values must be compared. Must be 1 or larger.

#### doubleDecrement(this double value, int count)

Decrements a floating point number to the next smaller number representable by the data type.
The decrementation step length depends on the provided value. Decrement(double.MinValue) will return negative infinity.
##### Parameters
###### `double` value

The value which should be decremented.

###### `int` count

How many times the number should be decremented.

##### Return
###### `double`

The next smaller floating point value.

#### doubleEpsilonOf(this double value)

Evaluates the minimum distance to the next distinguishable number near the argument value.
Evaluates the epsilon. The more common positive epsilon is equal to two times this negative epsilon.
##### Parameters
###### `double` value

The value used to determine the minimum distance.

##### Return
###### `double`

Relative Epsilon (positive double or NaN).

#### floatEpsilonOf(this float value)

Evaluates the minimum distance to the next distinguishable number near the argument value.
Evaluates the epsilon. The more common positive epsilon is equal to two times this negative epsilon.
##### Parameters
###### `float` value

The value used to determine the minimum distance.

##### Return
###### `float`

Relative Epsilon (positive float or NaN).

#### doubleIncrement(this double value, int count)

Increments a floating point number to the next bigger number representable by the data type.
The incrementation step length depends on the provided value. Increment(double.MaxValue) will return positive infinity.
##### Parameters
###### `double` value

The value which needs to be incremented.

###### `int` count

How many times the number should be incremented.

##### Return
###### `double`

The next larger floating point value.

#### boolIsFinite(this double value)

Checks if a given double values is finite, i.e. neither NaN nor inifnity
##### Parameters
###### `double` value

The value to be checked fo finitenes.

#### boolIsLarger(this float a, float b, double maximumAbsoluteError)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `float` b

The second value.

###### `double` maximumAbsoluteError

The absolute accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLarger(this float a, float b, int decimalPlaces)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `float` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLarger(this double a, double b, int decimalPlaces)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLarger(this double a, double b, double maximumAbsoluteError)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumAbsoluteError

The absolute accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLargerNumbersBetween(this double a, double b, long maxNumbersBetween)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the tolerance or not. Equality comparison is based on the binary representation.
##### Parameters

The first value.

###### `double` b

The second value.

###### `long` maxNumbersBetween

The maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLargerNumbersBetween(this float a, float b, long maxNumbersBetween)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the tolerance or not. Equality comparison is based on the binary representation.
##### Parameters

The first value.

###### `float` b

The second value.

###### `long` maxNumbersBetween

The maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLargerRelative(this float a, float b, int decimalPlaces)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `float` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLargerRelative(this double a, double b, double maximumError)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumError

The relative accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLargerRelative(this float a, float b, double maximumError)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `float` b

The second value.

###### `double` maximumError

The relative accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsLargerRelative(this double a, double b, int decimalPlaces)

Compares two doubles and determines if the `first` value is larger than the `second` value to within the specified number of decimal places or not.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of the numbers, e.g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is larger than the second value; otherwise `false`.

#### boolIsSmaller(this double a, double b, int decimalPlaces)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of th decimalPlaces g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmaller(this float a, float b, int decimalPlaces)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.

The values are equal if the difference between the two numbers is smaller than 10^(-numberOfDecimalPlaces). We divide by two so that we have half the range on each side of th decimalPlaces g. if decimalPlaces == 2, then 0.01 will equal between 0.005 and 0.015, but not 0.02 and not 0.00

##### Parameters

The first value.

###### `float` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmaller(this double a, double b, double maximumAbsoluteError)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumAbsoluteError

The absolute accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmaller(this float a, float b, double maximumAbsoluteError)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `float` b

The second value.

###### `double` maximumAbsoluteError

The absolute accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmallerNumbersBetween(this float a, float b, long maxNumbersBetween)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the tolerance or not. Equality comparison is based on the binary representation.
##### Parameters

The first value.

###### `float` b

The second value.

###### `long` maxNumbersBetween

The maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmallerNumbersBetween(this double a, double b, long maxNumbersBetween)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the tolerance or not. Equality comparison is based on the binary representation.
##### Parameters

The first value.

###### `double` b

The second value.

###### `long` maxNumbersBetween

The maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmallerRelative(this float a, float b, double maximumError)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `float` b

The second value.

###### `double` maximumError

The relative accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmallerRelative(this double a, double b, double maximumError)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `double` b

The second value.

###### `double` maximumError

The relative accuracy required for being almost equal.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmallerRelative(this float a, float b, int decimalPlaces)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `float` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolIsSmallerRelative(this double a, double b, int decimalPlaces)

Compares two doubles and determines if the `first` value is smaller than the `second` value to within the specified number of decimal places or not.
##### Parameters

The first value.

###### `double` b

The second value.

###### `int` decimalPlaces

The number of decimal places.

##### Return
###### `bool`

`true` if the first value is smaller than the second value; otherwise `false`.

#### boolListAlmostEqual(this IList<double> a, IList<double> b, int decimalPlaces)

Compares two lists of doubles and determines if they are equal within the specified maximum error.
##### Parameters
###### `IList<double>` a

The first value list.

###### `IList<double>` b

The second value list.

###### `int` decimalPlaces

The number of decimal places.

#### boolListAlmostEqual(this IList<double> a, IList<double> b, double maximumAbsoluteError)

Compares two lists of doubles and determines if they are equal within the specified maximum error.
##### Parameters
###### `IList<double>` a

The first value list.

###### `IList<double>` b

The second value list.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolListAlmostEqualNorm<T>(this IList<T> a, IList<T> b, double maximumAbsoluteError)

Compares two lists of doubles and determines if they are equal within the specified maximum error.
##### Parameters
###### `IList<T>` a

The first value list.

###### `IList<T>` b

The second value list.

###### `double` maximumAbsoluteError

The accuracy required for being almost equal.

#### boolListAlmostEqualNormRelative<T>(this IList<T> a, IList<T> b, double maximumError)

Compares two lists of doubles and determines if they are equal within the specified maximum error.
##### Parameters
###### `IList<T>` a

The first value list.

###### `IList<T>` b

The second value list.

###### `double` maximumError

The accuracy required for being almost equal.

#### boolListAlmostEqualRelative(this IList<double> a, IList<double> b, int decimalPlaces)

Compares two lists of doubles and determines if they are equal within the specified maximum error.
##### Parameters
###### `IList<double>` a

The first value list.

###### `IList<double>` b

The second value list.

###### `int` decimalPlaces

The number of decimal places.

#### boolListAlmostEqualRelative(this IList<double> a, IList<double> b, double maximumError)

Compares two lists of doubles and determines if they are equal within the specified maximum error.
##### Parameters
###### `IList<double>` a

The first value list.

###### `IList<double>` b

The second value list.

###### `double` maximumError

The accuracy required for being almost equal.

#### intMagnitude(this double value)

Returns the magnitude of the number.

The value.

##### Return
###### `int`

The magnitude of the number.

#### intMagnitude(this float value)

Returns the magnitude of the number.

The value.

##### Return
###### `int`

The magnitude of the number.

#### doubleMaximumMatchingFloatingPointNumber(this double value, long maxNumbersBetween)

Returns the floating point number that will match the value with the tolerance on the maximum size (i.e. the result is always bigger than the value)
##### Parameters

The value.

###### `long` maxNumbersBetween

The `ulps` difference.

##### Return
###### `double`

The maximum floating point number which is maxNumbersBetween larger than the given value.

#### doubleMinimumMatchingFloatingPointNumber(this double value, long maxNumbersBetween)

Returns the floating point number that will match the value with the tolerance on the minimum size (i.e. the result is always smaller than the value)
##### Parameters

The value.

###### `long` maxNumbersBetween

The `ulps` difference.

##### Return
###### `double`

The minimum floating point number which is maxNumbersBetween smaller than the given value.

#### ulongNumbersBetween(this double a, double b)

Evaluates the count of numbers between two double numbers
The second number is included in the number, thus two equal numbers evaluate to zero and two neighbor numbers evaluate to one. Therefore, what is returned is actually the count of numbers between plus 1.
##### Parameters
###### `double` a

The first parameter.

###### `double` b

The second parameter.

##### Return
###### `ulong`

The number of floating point values between a and b.

#### doublePositiveEpsilonOf(this double value)

Evaluates the minimum distance to the next distinguishable number near the argument value.
##### Parameters
###### `double` value

The value used to determine the minimum distance.

##### Return
###### `double`

Relative Epsilon (positive double or NaN)

#### floatPositiveEpsilonOf(this float value)

Evaluates the minimum distance to the next distinguishable number near the argument value.
##### Parameters
###### `float` value

The value used to determine the minimum distance.

##### Return
###### `float`

Relative Epsilon (positive float or NaN)

#### ValueTuple<double, double>RangeOfMatchingFloatingPointNumbers(this double value, long maxNumbersBetween)

Determines the range of floating point numbers that will match the specified value with the given tolerance.
##### Parameters

The value.

###### `long` maxNumbersBetween

The `ulps` difference.

##### Return
###### `ValueTuple<double, double>`

Tuple of the bottom and top range ends.

#### ValueTuple<long, long>RangeOfMatchingNumbers(this double value, double relativeDifference)

Determines the range of `ulps` that will match the specified value with the given tolerance.
##### Parameters

The value.

###### `double` relativeDifference

The relative difference.

##### Return
###### `ValueTuple<long, long>`

Tuple with the number of ULPS between the `value` and the `value - relativeDifference` as first, and the number of ULPS between the `value` and the `value + relativeDifference` as second value.

#### BigIntegerRound(this BigInteger number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `BigInteger` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `BigInteger`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### ulongRound(this ulong number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `ulong` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `ulong`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### ushortRound(this ushort number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `ushort` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `ushort`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### doubleRound(this double number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `double` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `double`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### floatRound(this float number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `float` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `float`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### decimalRound(this decimal number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `decimal` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `decimal`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### intRound(this int number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `int` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `int`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### uintRound(this uint number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `uint` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `uint`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### longRound(this long number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `long` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `long`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### shortRound(this short number, int digits)

Round to the number closest to 10^(-decimals). Negative decimals to round within the integer part.
##### Parameters
###### `short` number

Number to be rounded

###### `int` digits

If positive the number of decimals to round to. If negative the number of digits within the integer part to round, e.g. -3 will wound to the closes 1000.

##### Return
###### `short`

Rounded number

Show Example
`To round 123456789 to hundreds Round(123456789, -2) = 123456800  `

#### doubleRoundToMultiple(this double number, double basis)

Round to a multiple of the provided positive basis.
##### Parameters
###### `double` number

Number to be rounded.

###### `double` basis

The basis to whose multiples to round to. Must be positive.

#### floatRoundToMultiple(this float number, float basis)

Round to a multiple of the provided positive basis.
##### Parameters
###### `float` number

Number to be rounded.

###### `float` basis

The basis to whose multiples to round to. Must be positive.

#### decimalRoundToMultiple(this decimal number, decimal basis)

Round to a multiple of the provided positive basis.
##### Parameters
###### `decimal` number

Number to be rounded.

###### `decimal` basis

The basis to whose multiples to round to. Must be positive.

#### floatRoundToPower(this float number, float basis)

Round to a multiple of the provided positive basis.
##### Parameters
###### `float` number

Number to be rounded.

###### `float` basis

The basis to whose powers to round to. Must be positive.

#### doubleRoundToPower(this double number, double basis)

Round to a multiple of the provided positive basis.
##### Parameters
###### `double` number

Number to be rounded.

###### `double` basis

The basis to whose powers to round to. Must be positive.

#### doubleScaleUnitMagnitude(this double value)

Returns the number divided by it's magnitude, effectively returning a number between -10 and 10.

The value.

##### Return
###### `double`

The value of the number.

### Public fields

#### double DoublePrecision

Standard epsilon, the maximum relative precision of IEEE 754 double-precision floating numbers (64 bit). According to the definition of Prof. Demmel and used in LAPACK and Scilab.
 `return double`

#### double PositiveDoublePrecision

Standard epsilon, the maximum relative precision of IEEE 754 double-precision floating numbers (64 bit). According to the definition of Prof. Higham and used in the ISO C standard and MATLAB.
 `return double`

#### double SinglePrecision

Standard epsilon, the maximum relative precision of IEEE 754 single-precision floating numbers (32 bit). According to the definition of Prof. Demmel and used in LAPACK and Scilab.
 `return double`

#### double PositiveSinglePrecision

Standard epsilon, the maximum relative precision of IEEE 754 single-precision floating numbers (32 bit). According to the definition of Prof. Higham and used in the ISO C standard and MATLAB.
 `return double`

#### double MachineEpsilon

Actual double precision machine epsilon, the smallest number that can be subtracted from 1, yielding a results different than 1. This is also known as unit roundoff error. According to the definition of Prof. Demmel. On a standard machine this is equivalent to `DoublePrecision`.
 `return double`

#### double PositiveMachineEpsilon

Actual double precision machine epsilon, the smallest number that can be added to 1, yielding a results different than 1. This is also known as unit roundoff error. According to the definition of Prof. Higham. On a standard machine this is equivalent to `PositiveDoublePrecision`.
 `return double`

#### int DoubleDecimalPlaces

The number of significant decimal places of double-precision floating numbers (64 bit).
 `return int`

#### int SingleDecimalPlaces

The number of significant decimal places of single-precision floating numbers (32 bit).
 `return int`