Re: Thoughts and comments on P1788/D9.5
On 2015-01-10 15:13:09 +0200, Hossam A. H. Fahmy wrote:
> sumAbs(2, 3, +\infty, NaN)=+\infty
> while
> sum(2, 3, +\infty, NaN)=NaN.
> Is this desired?
Yes: if you replace NaN by any number x (finite or infinite),
sumAbs(2, 3, +\infty, x) will give +\infty. This is not true
for sum as +\infty + -\infty is an indeterminate form.
> The opposite order: "if a NaN is encountered, NaN shall be returned.
> Otherwise, if an infinity is encountered, $+\infty$ shall be returned."
> gives precedence to NaN. Which order is needed in P1788 applications?
>
> For those in the group who were also part of 754-2008: Was this change
> of order intentional in 754-2008 or an oversight? (I personally do not
> remember!)
This is consistent with the choice where NaN is regarded as
any number, not an error, like in hypot.
--
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)