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> ∅ ⪽ ℝtrueThe 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.
| Function | Symbol | Julia syntax | Description |
|---|---|---|---|
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.ℝ — Constant
ℝUnicode alias of entireinterval() representing an entire interval of default flavor and default bound type.
See also: entireinterval.
IntervalArithmetic.Symbols.∅ — Constant
∅Unicode alias of emptyinterval() representing an empty interval of default flavor and default bound type.
See also: emptyinterval.
IntervalArithmetic.Symbols.:.. — Method
..(a, b)
a .. bCreate the interval $[a, b]$ according to the IEEE Standard 1788-2015. This is semantically equivalent to interval(a, b).
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)IntervalArithmetic.Symbols.:± — Method
±(m, r)
m ± rCreate 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.
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)IntervalArithmetic.Symbols.:≛ — Function
≛(x, y)
x ≛ yUnicode alias of isequal_interval.
IntervalArithmetic.Symbols.:≺ — Function
≺(x, y)
x ≺ yUnicode alias of strictprecedes.
IntervalArithmetic.Symbols.:⊑ — Function
⊑(x, y)
x ⊑ yUnicode alias of issubset_interval.
IntervalArithmetic.Symbols.:⊓ — Function
⊓(x, y)
x ⊓ yUnicode alias of intersect_interval.
IntervalArithmetic.Symbols.:⊔ — Function
⊔(x, y)
x ⊔ yUnicode alias of hull.
IntervalArithmetic.Symbols.:⋤ — Function
⋤(x, y)
x ⋤ yUnicode alias of isstrictsubset.
IntervalArithmetic.Symbols.:⪯ — Function
⪯(x, y)
x ⪯ yUnicode alias of precedes.
IntervalArithmetic.Symbols.:⪽ — Function
⪽(x, y)
x ⪽ yUnicode alias of isinterior.