Re: [PATCH] Fix truncf for sNaN input

Joseph Myers <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Tue, 17 Mar 2020, Fabian Schriever wrote:

> On implementations that support the IEC60559: 1989 standard floating point,
> functions with signaling NaN argument(s) shall be treated as if the function
> were called with an argument that is a required domain error and shall return
> a quiet NaN result, except where stated otherwise.

This fails to allow for functions such as fabs where the corresponding 
IEEE operations pass through a signaling NaN rather than returning a quiet 
NaN with "invalid" raised.

Furthermore, TS 18661-1 makes it implementation-defined whether there is a 
domain error.  And in practice it's more convenient for implementations 
not to treat it as a domain error (not to set errno) as that means they 
can just e.g. add a NaN argument to itself rather than rather than 
explicitly testing for 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.