[std-interval] interval(NaN)

George Corliss George.Corliss at marquette.edu
Fri Sep 15 10:54:01 PDT 2006


All,

I want to pick up on one of John Pryce's issues: interval(NaN)

> For instance. At present "interval(NaN)" is mandated to return empty,
> but "interval(NaN, NaN)" need not. What happens if a safety-critical
> program developed on a system where "interval(NaN, NaN)" returns
> empty is ported to one where it returns whole, or some other value,
> or raises an exception?
> 
> The vast majority of machines on which interval computation will be used are
> - IEEE-conforming;
> - used by the general scientific community, for whom portability and
>    future-proofing of code is vastly important.
> 
> On a non-IEEE machine, if interval computation is used I believe it
> will be for a specialist purpose (e.g. embedded processor in
> avionics). Portability FROM such a machine TO a different platform
> will not be so important.
> 
> The standard should respect the needs of both these types of application.
John asks that the standard specify the behavior.  I agree.  Here, I want to
think about what the behavior should BE.

First, interval(NaN) should not be used by the programmer as a means for
constructing an instance of the empty set.  There is a constructor for that,
and the internal representation of empty should be hidden from the
applications programmer.

Hence, interval(NaN) is likely to come up in a context such as
   double w, x;
   x = mess of double code which happened to result in NaN;
   y = interval(x);
   z = interval(w, x);




More information about the Std-interval mailing list