Create an interval (from boundaries). Convert boundaries to double precision.
The syntax without parameters creates an (exact) empty interval. The syntax
with a single parameter infsup (M)
equals
infsup (M, M)
. The syntax infsup (S)
parses
an interval literal in inf-sup form or as a special value, where
infsup ("[S1, S2]")
is equivalent to infsup ("S1", "S2")
. A
second, logical output ISEXACT indicates if X’s boundaries both
have been converted without precision loss.
Each boundary can be provided in the following formats: literal constants [+-]inf[inity], e, pi; scalar real numeric data types, i. e., double, single, [u]int[8,16,32,64]; or decimal numbers as strings of the form [+-]d[,.]d[[eE][+-]d]; or hexadecimal numbers as string of the form [+-]0xh[,.]h[[pP][+-]d]; or decimal numbers in rational form [+-]d/d.
Also it is possible, to construct intervals from the uncertain form in the
form m?ruE
, where m
is a decimal mantissa,
r
is empty (= half ULP) or a decimal integer ULP count or a
second ?
character for unbounded intervals, u
is
empty or a direction character (u: up, d: down), and E
is an
exponential field.
If decimal or hexadecimal numbers are no binary64 floating point numbers, a tight enclosure will be computed. int64 and uint64 numbers of high magnitude (> 2^53) can also be affected from precision loss.
For the creation of interval arrays, arguments may be provided as (1) cell arrays with arbitrary/mixed types, (2) numeric arrays, or for matrices (3) strings. Scalar values do broadcast.
Non-standard behavior: This class constructor is not described by IEEE Std 1788-2015, IEEE standard for interval arithmetic, however it implements both standard functions numsToInterval and textToInterval for bare intervals.
infsup () ⇒ ans = [Empty] infsup ("[1]") ⇒ ans = [1] infsup (2, 3) ⇒ ans = [2, 3] infsup ("0.1") ⇒ ans ⊂ [0.099999, 0.10001] infsup ("0.1", "0.2") ⇒ ans ⊂ [0.099999, 0.20001] infsup ("0xff", "0x1.ffp14") ⇒ ans = [255, 32704] infsup ("1/3") ⇒ ans ⊂ [0.33333, 0.33334] infsup ("[1/9, 47/11]") ⇒ ans ⊂ [0.11111, 4.2728] infsup ("7.3?9u") ⇒ ans ⊂ [7.2999, 8.2001] infsup ("0??") ⇒ ans = [Entire] infsup ("911??de-2") ⇒ ans ⊂ [-inf, +9.1101] infsup ("10?") ⇒ ans = [9.5, 10.5]
See also: exacttointerval.
Package: interval