fmax/fmin sNaN compatibility question
Joseph Myers
joseph@codesourcery.com
Tue Dec 10 18:05:00 GMT 2019
On Tue, 10 Dec 2019, Ulrich Weigand wrote:
> Joseph Myers wrote:
> > On Mon, 9 Dec 2019, Ulrich Weigand wrote:
> > > Do you know why the sample implementation was even updated then?
> > > If FP_SNANS_ALWAYS_SIGNAL is false, shouldn't the C11 method then
> > > still be OK?
> >
> > The canonicalize call is needed in general to avoid propagating
> > noncanonical DFP encodings, though not relevant for binary FP.
>
> But it does change the behavior for binary FP as well, as far
> as I can see: e.g. if both inputs are sNaNs, the C11 method
> would return one of those sNaNs unchanged, while the C2x method
> will return a qNaN (as the canonicalize call will quiet the
> sNaN it receives as input), right?
The handling of sNaN is explicitly implementation-defined when
FE_SNANS_ALWAYS_SIGNAL is not defined, so that example implementation
should not be used to infer anything about how sNaN should be handled.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list