Interval<T> Structure

Represents an interval of ordered values.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
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 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 whether two instances of Interval<T> are equal.
Inequality(Interval<T>, Interval<T>) Returns whether two instances of Interval<T> are not equal.

See Also