This is the mail archive of the glibc-bugs@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]

[Bug manual/21400] Section "Infinity and NaN" of the libc manual


https://sourceware.org/bugzilla/show_bug.cgi?id=21400

--- Comment #6 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> ---
(In reply to joseph@codesourcery.com from comment #5)
> Non-associativity would presumably apply equally to hypot: 
> hypot(sNaN,hypot(qNaN,Inf)) is qNaN but hypot(hypot(sNaN,qNaN),Inf) is 
> Inf.  Of course the IEEE 754 hypot operation (corrected rounded) isn't 
> strictly associative for finite arguments anyway.

In any case, Inf is a correct answer. I suppose that for min/max, one may
consider that sNaN does not mean "missing data", and a non-NaN result could be
regarded as incorrect after the second call. Moreover, AFAIK, the
non-associativity of min/max is an issue mainly for those who wanted to
implement a min/max reduction operation by a sequence of 2-ary min/max in the
context of parallelism and wanted reproducibility. But as you say, hypot is
already not associative for finite arguments (so that results would not be
reproducible).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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