The submodule Symbols

IntervalArithmetic includes the submodule Symbols to make coding a bit simpler with respect to the use of some functions of the library. Some examples are provided here.

julia> using IntervalArithmetic, IntervalArithmetic.Symbolsjulia> a = 0 .. 2Interval{Float64}(0.0, 2.0, com, true)julia> b = 1 ± 0.5Interval{Float64}(0.5, 1.5, com, true)julia> a  atruejulia> b  atruejulia> b  atruejulia> true

The following table summarizes the functions, the usage with the corresponding (unicode) symbols, how to obtain the symbol in Julia, and a brief description of the function.

FunctionSymbolJulia syntaxDescription
interval(a, b; format=:infsup)..(a,b)Create interval [a, b] using bounds
interval(m, r; format=:midpoint)±(m, r)\pm<tab>Create interval [m - r, m + r] using midpoint-radius form
isequal_interval(x, y)≛(x, y)\starequal<tab>Check interval equality
issubset_interval(x, y)⊑(x, y)\sqsubseteq<tab>Check if x is a (non-strict) subset of y
isstrictsubset(x, y)⋤(x, y)\sqsubsetneq<tab>Check if x is a strict subset of y
isinterior(x, y)⪽(x, y)\subsetdot<tab>Check if x is in the interior of y
precedes(x, y)⪯(x, y)\preceq<tab>Precedes relation
strictprecedes(x, y)≺(x, y)\prec<tab>Strictly precedes relation
hull(x, y)⊔(x, y)\sqcup<tab>Interval hull of x and y
intersect_interval(x, y)⊓(x, y)\sqcap<tab>Intersection of intervals
emptyinterval()\emptyset<tab>Empty interval
entireinterval()\bbR<tab>Entire real line
IntervalArithmetic.Symbols.:..Method
..(a, b)
a .. b

Create the interval $[a, b]$ according to the IEEE Standard 1788-2015. This is semantically equivalent to interval(a, b).

Danger

Nothing is done to compensate for the fact that floating point literals are rounded to the nearest when parsed (e.g. 0.1). In such cases, parse the string containing the desired value to ensure its tight enclosure.

See also: interval, ± and @I_str.

Examples

julia> using IntervalArithmeticjulia> using IntervalArithmetic.Symbolsjulia> setdisplay(:full);julia> (1//1)..πInterval{Rational{Int64}}(1//1, 85563208//27235615, com, true)julia> 0.1..0.3Interval{Float64}(0.1, 0.3, com, true)
source
IntervalArithmetic.Symbols.:±Method
±(m, r)
m ± r

Create the interval $[m - r, m + r]$ according to the IEEE Standard 1788-2015. Despite using the midpoint-radius notation, the returned interval is still an Interval represented by its bounds.

Danger

Nothing is done to compensate for the fact that floating point literals are rounded to the nearest when parsed (e.g. 0.1). In such cases, parse the string containing the desired value to ensure its tight enclosure.

See also: interval, .. and @I_str.

Examples

julia> using IntervalArithmeticjulia> using IntervalArithmetic.Symbolsjulia> setdisplay(:full);julia> 0 ± πInterval{Float64}(-3.1415926535897936, 3.1415926535897936, com, true)julia> 0//1 ± πInterval{Rational{Int64}}(-85563208//27235615, 85563208//27235615, com, true)
source