Interval package: Difference between revisions

866 bytes added ,  15 October 2014
Added chapter about error handling
(added hyperlinks and minor corrections)
(Added chapter about error handling)
Line 151: Line 151:


=== Boolean operations ===
=== Boolean operations ===
=== Error handling ===
Due to the nature of set-based interval arithmetic, you should never observe errors during computation. If you do, there either is a bug in the code or there are unsupported data types.
octave:1> infsup (2, 3) / 0
ans = [Empty]
octave:2> pow (infsup (0), infsup (0))
ans = [Empty]
However, the interval constructors can produce errors depending on the input. The <code>infsup</code> constructor will fail if the interval boundaries are invalid. Contrariwise, the <code>infsupdec</code> constructor will only issue a warning and return a [NaI], which will propagate and survive through computations.
octave:3> infsup (3, 2) + 1
error: illegal interval boundaries: infimum greater than supremum
''… (call stack) …''
octave:3> infsupdec (3, 2) + 1
warning: illegal interval boundaries: infimum greater than supremum
ans = [NaI]


== Related work ==
== Related work ==
240

edits