This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fmax/fmin sNaN compatibility question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]