[stdinterval] Comments on the Interval Standard Proposal
Gabriel Dos Reis
gdr at integrablesolutions.net
Sun Oct 1 20:24:35 PDT 2006
Guillaume Melquiond <guillaume.melquiond at enslyon.fr> writes:
 Le dimanche 01 octobre 2006 à 17:41 +0200, Gabriel Dos Reis a écrit :

 >  2. From a library point of view, missing IEEE754 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 IEEE754, LIA1 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 LIA1.
 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 nonthrowing even when overflow may occur for
intermediate results) if the consensus is that the operations should
be nonthrowing.
[...]
 >  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 LIA1, then this aspect is
 > something to be described because LIA1 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 LIA1.
 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
More information about the Stdinterval
mailing list