Re: Alternate floating-point results under directed rounding
Sylvain Pion schrieb:
> Arnold Neumaier wrote:
>> Nobody had suggested that. The question is only whether a
>> floating-point +-inf or NaN should be converted into Empty,
>> or into a substitute finite point interval, or into a substitute
>> interval of positive width.
>
> Can't it be made an error?
> I am not sure how to properly word this in the standard, but for
> example one could define "undefined behavior", or raise some error
flag...?
Making it an error would perhaps be the best.
On the other hand, one may want to be able to trap the error,
to be able to do something alternative if the error occured...
That's why I proposed to use the nonstandardNumber flag.
I wouldn't mind using a different flag...
> If we return an interval from Inf or Nan, then the whole R interval
> [-inf,+inf] is IMO the only one which can offer some guarantee.
> But then, of course, one might think that the following computations
> with such an interval are probably useless, and it might be best to
> take this as an error as soon as possible, or leave it "undefined
behavior"
> to not force the performance penalty of checking the error case if
> we think it is worth supporting a fast mode here.
>
> [+maxreal,+inf] seems inconsistent to me here, since, if the goal is to
> try to somehow recover from a value that overflowed, then there is
> no guarantee that this value would have been in [+maxreal,+inf].
> For example if the value +inf comes from the computation of
> (+maxreal + 1) - 2.
> (since +maxreal + 1 gives +inf, and then +inf - 2 gives +inf,
> but the exact value is +maxreal -1).
I agree.
Arnold Neumaier