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


Joseph Myers wrote:
> 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.

Ah, this is what I missed.  Thanks!

So just to clarify: there was a sample implementation in C11, and now there
is a (different) sample implementation in TS 18661-1 / C2x, but the expected
behavior in FP_SNANS_ALWAYS_SIGNAL mode is neither of those, but rather the
behavior described by maxNum from IEEE 754-2008.  Right?

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?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


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