Check whether the value x is contained in the interval, i.e. whether a <= x <= b or b <= x <= a.
If a > b, swap the endpoints.
Determine whether the interval is infinite. This is true if:
If T is an integer type, this is always false.
Determine whether this is an ordered interval, i.e. whether a <= b.
The length of the interval, defined as b-a.
An interval [a,b] along the real line, where either endpoint may be infinite.