Interval<T> Structure

Represents an interval of ordered values.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
[SerializableAttribute]
public struct Interval<T> : IEquatable<Interval<T>>, 
	IComparable<Interval<T>>
Inheritance
Object  →  ValueType  →  Interval<T>
Implements
IComparable<Interval<T>>, IEquatable<Interval<T>>

Type Parameters

T

Remarks

Use the Interval<T> structure to represent an interval of ordered values. The type of the values must support the IComparable<T> interface.

The LowerBound and UpperBound properties return the bounds of the interval. The Contains(T) method determines whether a value is contained within an interval.

Constructors

Interval<T> Constructs a new interval.

Properties

LowerBound Gets the lower bound of the interval.
UpperBound Gets the upper bound of the interval.
Width Gets the width of the interval.

Methods

CompareTo Compares two intervals.
Contains Tests whether an object is contained in the interval.
Equals(Interval<T>) Returns whether this interval is equal to another interval.
Equals(Object) Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueType.Equals(Object))
GetHashCode Returns the hash code for this instance.
(Overrides ValueType.GetHashCode())
GetTypeGets the Type of the current instance.
(Inherited from Object)
ToString() Gets a string representation of the interval.
(Overrides ValueType.ToString())
ToString(String) Gets a string representation of the interval.
ToString(String, IFormatProvider) Gets a string representation of the interval.

Operators

Equality(Interval<T>, Interval<T>) Returns a value indicating whether two instances of Interval<T> are equal.
Inequality(Interval<T>, Interval<T>) Returns a value indicating whether two instances of Interval<T> are not equal.

See Also