Interval Structure

Represents an interval of real numbers.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
C#
[SerializableAttribute]
public struct Interval
Inheritance
Object  →  ValueType  →  Interval

Remarks

Use the Interval structure to represent an interval of real numbers. The LowerBound and UpperBound properties return the bounds of the interval. The Width property returns the width of the interval. The Contains(Double) method determines whether a value is contained within an interval.

Arithmetic operators are defined for combining intervals. For languages that do not support operator overloading, equivalent static methods have been supplied.

Interval structures are immutable. The lower and upper bounds can not be changed. Use the constructor or one of the operator methods to create an Interval with new values for the boundaries.

Constructors

Interval Constructs a new interval.

Properties

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

Methods

Add(Double, Interval) Returns an interval shifted by a specified value..
Add(Interval, Interval) Returns the sum of two intervals.
Add(Interval, Double) Returns an interval shifted by a specified value..
Contains Tests whether a number is contained in the interval.
Divide Returns a scaled interval.
Equals 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)
Multiply(Double, Interval) Returns a scaled interval.
Multiply(Interval, Double) Returns a scaled interval.
Subtract(Double, Interval) Returns an interval negated and shifted to the right by a specified value.
Subtract(Interval, Interval) Returns the sum of two intervals.
Subtract(Interval, Double) Returns an interval shifted to the left by a specified value.
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

Addition(Double, Interval) Returns an interval shifted by a specified value..
Addition(Interval, Interval) Returns the sum of two intervals.
Addition(Interval, Double) Returns an interval shifted by a specified value..
Division(Interval, Double) Returns a scaled interval.
Equality(Interval, Interval) Returns whether two instances of Interval are equal.
Implicit(Interval to Interval<Double>) Implicitly converts a specialized interval of real numbers to a generic interval.
Implicit(Interval<Double> to Interval) Implicitly converts a generic interval of real numbers to a specialized interval.
Inequality(Interval, Interval) Returns whether two instances of Interval are not equal.
Multiply(Double, Interval) Returns a scaled interval.
Multiply(Interval, Double) Returns a scaled interval.
Subtraction(Double, Interval) Returns an interval negated and shifted to the right by a specified value.
Subtraction(Interval, Interval) Returns the sum of two intervals.
Subtraction(Interval, Double) Returns an interval shifted to the left by a specified value.

See Also