On Thu, Feb 19, 2009 at 6:17 AM, Sylvain Pion
<Sylvain.Pion@xxxxxxxxxxxxxxx> wrote:
Siegfried M. Rump wrote :
In a nutshell, defining interval to consist only of finite
numbers is a nice concept, but various exceptional operations
such as 0*inf or inf-inf have to be identified and redefined.
For example, this slows down addition by about a factor 2.
I am afraid, a penalty might also apply to a C- or Fortran
implementation.
Dear Siegfried,
What we ended up doing in the draft proposal for C++ was to invoke
"undefined behavior" in such situations (e.g. when constructing
an interval from a non-finite value). "Undefined behavior" is
defined in the C++ standard and means "anything can happen".
That may be appropriate for the C++ standard document -- because,
among other things C++ is in general very loose about numerics
(there isn't even a notion of accuracy). However, I'm highly skeptical
that "undefined behaviour" in general helps a standard specifically crafted
for scientific computations and reproducibility of results.
There are various options beside "undefined behavour". If the
purprose is to leave something up to the implementation, I would
think "implemented defined behaviour" should be that. It leaves
the choice to the implementation, but it does require the implementation
to document its choice.
"Undefined behaviour" is not something the C or the C++ community
is proud of (you probably remember efforts by some of us to reduce
the number of undefined behaviour.) I find it suspicious that this
body would want to promote it.