Previous Up Next

6.38.3  Interval arithmetic: + - * /

You can apply the usual arithmetic operators, such as +, -, * and /, to intervals.

The result of adding two intervals is the interval whose endpoints are the sums of the left end points and the right end points.


Example.
Input:

i[1,4] + i[2,3]

Output:

[3.00000000000000..7.00000000000000]


The negative of an interval is the result of taking the negative of the end points of the interval. The new end points will have to be switched.


Example.
Input:

-i[2,3]

Output:

[−3.00000000000000..−2.00000000000000]


The product of two intervals is the interval whose endpoints are the product the left endpoints of the two intervals and the product of the right endpoints of the two intervals. The smallest product will be the left end point of the product interval, and the largest product will be the right end point of the product interval.


Examples.

The reciprocal of an interval is the interval determined by the reciprocals of the end points.


Examples.


If the original interval has zero as an end point, then the reciprocal interval will have plus or minus infinity as one of the end points. If one end point is positive and the other is negative, then the reciprocal will simply be the interval from -infinity to infinity.


Examples.


You can also, if you want, do the usual operations such as subtraction, division, powers and roots.


Previous Up Next