# [std-interval] Comments on the Interval Standard Proposal

Gabriel Dos Reis gdr at integrable-solutions.net
Sun Oct 1 20:24:35 PDT 2006

```Guillaume Melquiond <guillaume.melquiond at ens-lyon.fr> writes:

| Le dimanche 01 octobre 2006 à 17:41 +0200, Gabriel Dos Reis a écrit :
|
| > | 2. From a library point of view, missing IEEE-754 infinities make the
| > | code a bit more complicated and a lot slower, as you need to detect
| > | overflows by hand. Representation doesn't even require extra data
| > | members, as half of the data space is left unused by proper intervals,
| > | so you can store unbounded intervals by using reversed bounds.
| >
| > For implementations lacking IEEE-754, LIA-1 semantics is that if an
| > operation is to overflow then it should raise an exception.  So, your
| > specification has to explicilty take that into account saying whether
| > the library functions are allowed to raise exceptions or not.
|
| I don't understand. Overflow does not mean anything for an interval
| function.

I hope so.

However, the "operations" above refer to the scalar type which
interval is based on.  And those can overflow, therefore throw
according go LIA-1.

| If an implementation wants to use internal operations that may
| throw an exception, then it just has to catch it and deal with it.

good; that should be spelled out in the specification (e.g. the
operations are non-throwing even when overflow may occur for
intermediate results) if the consensus is that the operations should
be non-throwing.

[...]

| > | 3. From a user point of view, missing infinities give unexpected results
| > | for the value access functions when dealing with unbounded intervals.
| >
| > If you hook the interval library on LIA-1, then this aspect is
| > something to be described because LIA-1 does nto mandate infinities.
| > Instead, it mandates exceptions.
|
| I don't hook the interval library to anything.

but you certainly want to say what interval<double> does, given the
semantics of double.  That in turn is described in part by
numeric_limits<double> which is modelled after LIA-1.

| There are no expectation
| on the presence or not of infinities in the proposal, as all the
| references to them are protected by std::numeric_limits<T>::
| has_infinity.

that is where I was.  The other instance of this problem is when
numeric_limits<T>::is_iec559 is true.

-- Gaby

```