Class IntervalSize
Provides a test for whether an interval is
so small it should be considered as zero for the purposes of
inserting it into a binary tree.
The reason this check is necessary is that round-off error can
cause the algorithm used to subdivide an interval to fail, by
computing a midpoint value which does not lie strictly between the
endpoints.
Inheritance
System.Object
IntervalSize
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.Collections
Assembly: Mars.Common.dll
Syntax
public class IntervalSize
Fields
| Improve this Doc View SourceMinBinaryExponent
This value is chosen to be a few powers of 2 less than the
number of bits available in the double representation (i.e. 53).
This should allow enough extra precision for simple computations to be correct,
at least for comparison purposes.
Declaration
public const int MinBinaryExponent = -50
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceIsZeroWidth(Double, Double)
Computes whether the interval [min, max] is effectively zero width.
I.e. the width of the interval is so much less than the
location of the interval that the midpoint of the interval cannot be
represented precisely.
Declaration
public static bool IsZeroWidth(double min, double max)
Parameters
Type | Name | Description |
---|---|---|
System.Double | min | |
System.Double | max |
Returns
Type | Description |
---|---|
System.Boolean |