[Cfp-interest 2317] Re: infinity and exceptions

Vincent Lefevre vincent at vinc17.net
Thu Jan 13 15:31:00 PST 2022


On 2021-12-28 20:09:46 -0800, Fred J. Tydeman wrote:
> I wonder if we should change 5.2.4.2.2#4:
> 
> A quiet NaN propagates through almost
> every arithmetic operation without raising a floating-point exception; a signaling NaN generally
> raises a floating-point exception when occurring as an arithmetic operand.23)
> 
> to
> 
> Both infinity and a quiet NaN propagates through almost
> every arithmetic operation without raising a floating-point exception; a signaling NaN generally
> raises a floating-point exception when occurring as an arithmetic operand.23)

Infinity does not propagate. A result may be an infinity, but
not always, e.g. 1 / +inf = +0, and the sign may be different:
0 - +inf = -inf.

> I do not see any place in the C standard that the use of
> INFINITY shall be quiet (in most cases).  One exception is
> INFINITY / INFINITY (which raises invalid)..

and 0 * INFINITY.

-- 
Vincent Lefèvre <vincent at vinc17.net> - 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)


More information about the Cfp-interest mailing list