Parameters
double a
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.
Type Precision
Namespace MathNet.Numerics
Useful links:
double aThe first number
double bThe second number
booltrue if the two values differ by no more than 10 * 2^(-52); false otherwise.
Complex aThe first number
Complex bThe second number
booltrue if the two values differ by no more than 10 * 2^(-52); false otherwise.
double aThe first value.
double bThe second value.
double maximumAbsoluteErrorThe accuracy required for being almost equal.
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places.
float aThe first value.
float bThe second value.
double maximumAbsoluteErrorThe accuracy required for being almost equal.
float aThe first value.
float bThe second value.
int decimalPlacesThe number of decimal places.
Complex aThe first value.
Complex bThe second value.
double maximumAbsoluteErrorThe accuracy required for being almost equal.
float aThe first number
float bThe second number
booltrue if the two values differ by no more than 10 * 2^(-52); false otherwise.
Complex aThe first value.
Complex bThe second value.
int decimalPlacesThe number of decimal places.
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
double aThe norm of the first value (can be negative).
double bThe norm of the second value (can be negative).
double diffThe norm of the difference of the two values (can be negative).
int decimalPlacesThe number of decimal places.
double aThe norm of the first value (can be negative).
double bThe norm of the second value (can be negative).
double diffThe norm of the difference of the two values (can be negative).
double maximumAbsoluteErrorThe absolute accuracy required for being almost equal.
boolTrue if both doubles are almost equal up to the specified maximum absolute error, false otherwise.
T aThe first value.
T bThe second value.
double maximumAbsoluteErrorThe absolute accuracy required for being almost equal.
boolTrue if both doubles are almost equal up to the specified maximum absolute error, false otherwise.
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
T aThe first value.
T bThe second value.
int decimalPlacesThe number of decimal places.
double aThe norm of the first value (can be negative).
double bThe norm of the second value (can be negative).
double diffThe norm of the difference of the two values (can be negative).
double maximumErrorThe accuracy required for being almost equal.
boolTrue if both doubles are almost equal up to the specified maximum error, false otherwise.
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
double aThe norm of the first value (can be negative).
double bThe norm of the second value (can be negative).
double diffThe norm of the difference of the two values (can be negative).
int decimalPlacesThe number of decimal places.
T aThe first value.
T bThe second value.
double maximumErrorThe accuracy required for being almost equal.
boolTrue if both doubles are almost equal up to the specified maximum error, false otherwise.
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
T aThe first value.
T bThe second value.
int decimalPlacesThe number of decimal places.
float aThe first value.
float bThe second value.
int maxNumbersBetweenThe maximum number of floating point values between the two values. Must be 1 or larger.
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.
double aThe first value.
double bThe second value.
long maxNumbersBetweenThe maximum number of floating point values between the two values. Must be 1 or larger.
Complex aThe first value.
Complex bThe second value.
int decimalPlacesThe number of decimal places.
double aThe first value.
double bThe second value.
double maximumErrorThe accuracy required for being almost equal.
Complex aThe first value.
Complex bThe second value.
double maximumErrorThe accuracy required for being almost equal.
float aThe first value.
float bThe second value.
int decimalPlacesThe number of decimal places.
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places.
double aThe first number
double bThe second number
booltrue if the two values differ by no more than 10 * 2^(-52); false otherwise.
float aThe first number
float bThe second number
booltrue if the two values differ by no more than 10 * 2^(-52); false otherwise.
Complex aThe first number
Complex bThe second number
booltrue if the two values differ by no more than 10 * 2^(-52); false otherwise.
float aThe first value.
float bThe second value.
double maximumErrorThe accuracy required for being almost equal.
double aThe real number to coerce to zero, if it is almost zero.
long maxNumbersBetweenThe maximum count of numbers between the zero and the number a.
doubleZero if | a | is fewer than maxNumbersBetween numbers from zero, a otherwise.
double aThe real number to coerce to zero, if it is almost zero.
int maxNumbersBetweenThe maximum count of numbers between the zero and the number a.
doubleZero if | a | is fewer than maxNumbersBetween numbers from zero, a otherwise.
double aThe real number to coerce to zero, if it is almost zero.
double maximumAbsoluteErrorThe absolute threshold for a to consider it as zero.
doubleZero if | a | is smaller than maximumAbsoluteError , a otherwise.
double aThe real number to coerce to zero, if it is almost zero.
doubleZero if | a | is smaller than 2^(-53) = 1.11e-16, a otherwise.
double aThe first value.
double bThe second value.
double maximumAbsoluteErrorThe absolute accuracy required for being almost equal.
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places on which the values must be compared. Must be 1 or larger.
double aThe first value.
double bThe second value.
long maxNumbersBetweenThe 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.
double aThe first value.
double bThe second value.
double maximumErrorThe relative accuracy required for being almost equal.
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places on which the values must be compared. Must be 1 or larger.
The decrementation step length depends on the provided value. Decrement(double.MinValue) will return negative infinity.
double valueThe value which should be decremented.
int countHow many times the number should be decremented.
doubleThe next smaller floating point value.
Evaluates the epsilon. The more common positive epsilon is equal to two times this negative epsilon.
double valueThe value used to determine the minimum distance.
doubleRelative Epsilon (positive double or NaN).
Evaluates the epsilon. The more common positive epsilon is equal to two times this negative epsilon.
float valueThe value used to determine the minimum distance.
floatRelative Epsilon (positive float or NaN).
The incrementation step length depends on the provided value. Increment(double.MaxValue) will return positive infinity.
double valueThe value which needs to be incremented.
int countHow many times the number should be incremented.
doubleThe next larger floating point value.
double valueThe value to be checked fo finitenes.
first value is larger than the second value to within the specified number of decimal places or not.
float aThe first value.
float bThe second value.
double maximumAbsoluteErrorThe absolute accuracy required for being almost equal.
booltrue if the first value is larger than the second value; otherwise false.
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
float aThe first value.
float bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is larger than the second value; otherwise false.
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
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is larger than the second value; otherwise false.
first value is larger than the second value to within the specified number of decimal places or not.
double aThe first value.
double bThe second value.
double maximumAbsoluteErrorThe absolute accuracy required for being almost equal.
booltrue if the first value is larger than the second value; otherwise false.
first value is larger than the second value to within the tolerance or not. Equality comparison is based on the binary representation.
double aThe first value.
double bThe second value.
long maxNumbersBetweenThe maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.
booltrue if the first value is larger than the second value; otherwise false.
first value is larger than the second value to within the tolerance or not. Equality comparison is based on the binary representation.
float aThe first value.
float bThe second value.
long maxNumbersBetweenThe maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.
booltrue if the first value is larger than the second value; otherwise false.
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
float aThe first value.
float bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is larger than the second value; otherwise false.
first value is larger than the second value to within the specified number of decimal places or not.
double aThe first value.
double bThe second value.
double maximumErrorThe relative accuracy required for being almost equal.
booltrue if the first value is larger than the second value; otherwise false.
first value is larger than the second value to within the specified number of decimal places or not.
float aThe first value.
float bThe second value.
double maximumErrorThe relative accuracy required for being almost equal.
booltrue if the first value is larger than the second value; otherwise false.
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
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is larger than the second value; otherwise false.
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
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is smaller than the second value; otherwise false.
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
float aThe first value.
float bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the specified number of decimal places or not.
double aThe first value.
double bThe second value.
double maximumAbsoluteErrorThe absolute accuracy required for being almost equal.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the specified number of decimal places or not.
float aThe first value.
float bThe second value.
double maximumAbsoluteErrorThe absolute accuracy required for being almost equal.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the tolerance or not. Equality comparison is based on the binary representation.
float aThe first value.
float bThe second value.
long maxNumbersBetweenThe maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the tolerance or not. Equality comparison is based on the binary representation.
double aThe first value.
double bThe second value.
long maxNumbersBetweenThe maximum number of floating point values for which the two values are considered equal. Must be 1 or larger.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the specified number of decimal places or not.
float aThe first value.
float bThe second value.
double maximumErrorThe relative accuracy required for being almost equal.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the specified number of decimal places or not.
double aThe first value.
double bThe second value.
double maximumErrorThe relative accuracy required for being almost equal.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the specified number of decimal places or not.
float aThe first value.
float bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is smaller than the second value; otherwise false.
first value is smaller than the second value to within the specified number of decimal places or not.
double aThe first value.
double bThe second value.
int decimalPlacesThe number of decimal places.
booltrue if the first value is smaller than the second value; otherwise false.
IList<double> aThe first value list.
IList<double> bThe second value list.
int decimalPlacesThe number of decimal places.
IList<double> aThe first value list.
IList<double> bThe second value list.
double maximumAbsoluteErrorThe accuracy required for being almost equal.
IList<T> aThe first value list.
IList<T> bThe second value list.
double maximumAbsoluteErrorThe accuracy required for being almost equal.
IList<T> aThe first value list.
IList<T> bThe second value list.
double maximumErrorThe accuracy required for being almost equal.
IList<double> aThe first value list.
IList<double> bThe second value list.
int decimalPlacesThe number of decimal places.
IList<double> aThe first value list.
IList<double> bThe second value list.
double maximumErrorThe accuracy required for being almost equal.
double valueThe value.
intThe magnitude of the number.
float valueThe value.
intThe magnitude of the number.
double valueThe value.
long maxNumbersBetweenThe ulps difference.
doubleThe maximum floating point number which is maxNumbersBetween larger than the given value.
double valueThe value.
long maxNumbersBetweenThe ulps difference.
doubleThe minimum floating point number which is maxNumbersBetween smaller than the given value.
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.
double aThe first parameter.
double bThe second parameter.
ulongThe number of floating point values between a and b.
Evaluates the epsilon. See also EpsilonOf
double valueThe value used to determine the minimum distance.
doubleRelative Epsilon (positive double or NaN)
Evaluates the epsilon. See also EpsilonOf
float valueThe value used to determine the minimum distance.
floatRelative Epsilon (positive float or NaN)
double valueThe value.
long maxNumbersBetweenThe ulps difference.
ValueTuple<double, double>Tuple of the bottom and top range ends.
ulps that will match the specified value with the given tolerance.
double valueThe value.
double relativeDifferenceThe relative difference.
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.
BigInteger numberNumber to be rounded
int digitsIf 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.
BigIntegerRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
ulong numberNumber to be rounded
int digitsIf 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.
ulongRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
ushort numberNumber to be rounded
int digitsIf 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.
ushortRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
double numberNumber to be rounded
int digitsIf 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.
doubleRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
float numberNumber to be rounded
int digitsIf 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.
floatRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
decimal numberNumber to be rounded
int digitsIf 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.
decimalRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
int numberNumber to be rounded
int digitsIf 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.
intRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
uint numberNumber to be rounded
int digitsIf 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.
uintRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
long numberNumber to be rounded
int digitsIf 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.
longRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
short numberNumber to be rounded
int digitsIf 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.
shortRounded number
To round 123456789 to hundreds Round(123456789, -2) = 123456800
double numberNumber to be rounded.
double basisThe basis to whose multiples to round to. Must be positive.
float numberNumber to be rounded.
float basisThe basis to whose multiples to round to. Must be positive.
decimal numberNumber to be rounded.
decimal basisThe basis to whose multiples to round to. Must be positive.
float numberNumber to be rounded.
float basisThe basis to whose powers to round to. Must be positive.
double numberNumber to be rounded.
double basisThe basis to whose powers to round to. Must be positive.
double valueThe value.
doubleThe value of the number.
return double
|
return double
|
return double
|
return double
|
return double
|
return double
|
return int
|
return int
|