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.
return bool |
if both doubles are equal to each other within the specified tolerance; otherwise . |
double a |
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. |