+++ title = "Intervals" +++
There are several Julia packages for interval sets and interval arithmetic.
\toc
IntervalSets.jl and Intervals.jl both focus on working with interval sets, in a mathematical sense (as opposed to a numerical sense). While there have been discussions on merging the two (see IntervalSets.jl#67 and Intervals.jl#94), they currently still exist as separate packages.
IntervalArithmetic.jl on the other hand focuses on interval arithmetic, i.e. carrying out operations like
{{badge IntervalSets}}
{{badge Intervals}}
{{badge IntervalArithmetic}} Example of adding an interval and a number:
julia> a = 1;
julia> b = interval(3, 4)
[3.0, 4.0]_com
julia> a+b
[4.0, 5.0]_com_NG
Examples of applying a function to an interval:
julia> f(interval(3, 4))
[9.0, 16.0]_com
julia> f(interval(-3, 4))
[0.0, 16.0]_com
To quote from the intro of the IntervalArithmetic.jl docs:
Since f(x) does not contain 0, the true range of the function
$f$ over the interval$[3,4]$ is guaranteed not to contain 00, and hence we obtain the following property.Theorem:
$f$ has no root in the interval$[3,4]$ .This theorem has been obtained using floating-point computations!
{{star_history IntervalSets Intervals IntervalArithmetic}}