[std-interval] Comments on the Interval Standard Proposal
Gabriel Dos Reis
gdr at integrable-solutions.net
Sun Oct 1 18:41:10 PDT 2006
Guillaume Melquiond <guillaume.melquiond at ens-lyon.fr> writes:
| Le dimanche 01 octobre 2006 à 01:26 +0200, Gabriel Dos Reis a écrit :
| > Sylvain Pion <Sylvain.Pion at sophia.inria.fr> writes:
| > | Gabriel Dos Reis a écrit :
| > | > | For implementations which do not support infinity, how do you check if
| > | > | an interval is bounded ? Currently we can't.
| > | > Hmm, I'm unclear about this one. If the implementation does not
| > | > support infinity, does not it follow all intervals are bounded?
| > |
| > | I was thinking that implementations could store extra data members
| > | specifying if a bound is infinite. You can't return it through
| > | .lower(), because the floating-point type does not have a value
| > | for infinity, but is_positively_bounded() can return the
| > | information.
| > Aha. So, is it accurate to summarize the issue as to how to support
| > unbounded intervals even where the implementation has bounded
| > arithmetic for scalar arithmetic types?
| Your summary may be a bit short.
I like "short" summaries, i.e. summaries.
| 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.
| 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.
More information about the Std-interval