From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F1E73858C5F; Wed, 28 Feb 2024 01:06:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F1E73858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709082400; bh=1xEXtROoGefUKnFbISECP+tRvbhb4GwXImjefuXj5jY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FkjjgElCgH56Pzt0Gvtu79zwyRAEWIDRJ9VZL4MGwxdUNsYt/nXQnsOcxYUSNQSip nSCZemuJ3kgdnFQDOpz/5vYnAQSf4JAuT1GWBxtatyfzPnXpVtIg2TcH85XNNhbTjN d1GdGJb88Y0nQRvDglC3/NUNMtkio296kF76tybM= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libquadmath/114140] different results for std::fmin/std::fmax and quadmath fminq/fmaxq if one argument=signaling_NaN Date: Wed, 28 Feb 2024 01:06:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libquadmath X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114140 --- Comment #10 from Andrew Pinski --- (In reply to g.peterhoff from comment #7) > I think there is a misunderstanding. The problem is that std::fmin/std::f= max > and quadmath fminq/fmaxq give different results when only *one* argument = is > signaling_NaN. > The standard (https://en.cppreference.com/w/cpp/numeric/math/fmin + > https://en.cppreference.com/w/cpp/numeric/math/fmax) says: > * If one of the two arguments is NaN, the value of the other argument is > returned > * Only if both arguments are NaN, NaN is returned >=20 > quadmath fminq/fmaxq also return NaN if only *one* argument is signaling_= NaN. The cppreference page is wrong. See https://sourceware.org/bugzilla/show_bug.cgi?id=3D20947 for reference o= n why.=