[std-interval] Revised document available

Guillaume Melquiond guillaume.melquiond at ens-lyon.fr
Sat Sep 16 15:28:26 PDT 2006


Le jeudi 14 septembre 2006 à 23:29 +0100, Dr John Pryce a écrit :

> 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?

If the program relies on "interval(NaN,NaN)" returning an empty
interval, then the program is not conforming to the C++ Standard
(according to the current proposal). As such, it should not be be
expected to work with a C++ Standard compliant compiler/environment.

Programming by coincidence is the worst way to develop a "safety-
critical" application. It is not sufficient to say: the program seems to
work in one environment so it should work in any environment (Ariane 5
maiden flight comes to mind). The main point of the standard is to write
rules that give a guarantee of portability; if the rules are not
respected, all bets are off.

> 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.

I disagree. A standard should never bother with people who are not
interested in portability. This would go against the whole point of
being a "standard". When writing a portable program in C++, people
should always keep in mind that the C++ Standard does require neither
IEC-559 nor LIA-1 compliance.

As a consequence, I feel that we should avoid standardizing behavior for
floating-point values that are not mandated by the C++ standard,
whenever possible. That's why infinite and NaN are mentioned only in the
few places where we felt it could be useful to take them into account.
The behavior is left undefined in the other places. In particular, I
don't believe it is actually useful to define the behavior of
interval(NaN,NaN). If it is left undefined, people will not have any
incentive to use it.

Best regards,

Guillaume



More information about the Std-interval mailing list