fmax/fmin sNaN compatibility question

Joseph Myers joseph@codesourcery.com
Mon Dec 9 17:23:00 GMT 2019


On Mon, 9 Dec 2019, Ulrich Weigand wrote:

> Now I've been looking at TS 18661-1 (either n1809 or n2314) and I don't
> see where it defines the semantics in this way.
> 
> In fact, the clearest statement seems to be the sample implementation
> in F.10.9.2, paragraph 3, which according to TS 18661-1 now should be:
> 
> {
>   double r;
>   r = (isgreaterequal(x, y) || isnan(y)) ? x : y;
>   (void) canonicalize(&r, &r);
>   return r;
> }

See the "Append to footnote 374): Note also that this implementation does 
not handle signaling NaNs as required of implementations that define 
FP_SNANS_ALWAYS_SIGNAL." in TS 18661-1.

fmax is the maxNum operation from IEEE 754-2008 that was removed in IEEE 
754-2019; see the table of operation bindings in TS 18661-1.  It is *not* 
the maximum or maximumNumber operation from IEEE 754-2019 (there's a 
separate proposal for C bindings for those operations, with different 
names; implementing those operations has its own complication that they 
require -0 to compare less than +0, which maxNum doesn't, although the 
choice of a decimal cohort member where both arguments are members of the 
same cohort with different quantum exponents is still unspecified).

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list