Algorithmic Solutions > LEDA > LEDA Guide > Number Types > Interval Arithmetic

Interval Arithmetic

The data type interval provides a clean and efficient way to compute approximately with reals by inexact interval arithmetic.

Each input number `xi` is converted into an interval `{xi}` and all real operations are replaced by interval operations. If `z` is the result of the exact real calculation and `I` is the interval computed by `interval`, then `I` contains `z`, i.e., `I` is a more or less accurate approximation of `z`. In many cases `I` is small enough to be useful, e.g., to know the sign of the computation.

Strengths

• computes an error bound for the result of a computation
• more efficient than exact real arithmetic
• member function `I.sign_is_known()` returns true if and only if all numbers in I have the same sign.

• slower than corresponding operations on doubles

Tips

Use Interval Arithmetic to speed up your computations with reals, and recompute with `real` if the result is not unique.

Floating Point Filters

Integers of Arbitrary Length

Algebraic Real Numbers

Rational Numbers

Vectors and Matrices with Integer Entries

Vectors and Matrices with Double Entries

Rational Vectors

Functions of numerical analysis

Manual Page Interval Arithmetic