Re: Fw: [PATCH 0/3] libm: Clean up gamma functions

Joseph Myers <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Thu, 27 Aug 2020, Keith Packard via Newlib wrote:

>         +INFINITY input and +INFINITY output generate *no* error
>         presumably because there's an assumption that the computation
>         which resulted in +INFINITY being provided to these functions
>         already raised a FE_OVERFLOW exception, and perhaps an ERANGE
>         errno.

The basic principles for infinite results from IEEE floating-point 
operations and libm functions are that overflow is when infinity is an 
*inexact* result from rounding (or, in some rounding modes, the largest 
finite value results from rounding but rounding with infinite exponent 
range would have produced an exponent that could not be represented in the 
actual format).  Divide by zero is when infinity is an *exact* result from 
*finite* arguments.  If infinity is an exact result and at least one 
argument is infinite, there is no error or exception (unless it's some of 
the new minimum/maximum operations in IEEE 754-2019 and the other argument 
is a signaling NaN).

-- 
Joseph S. Myers
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.