From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 250603858C98; Wed, 28 Feb 2024 01:02:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 250603858C98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709082176; bh=IVcDTEc483g3J3ShzvBfA1iiF5vyLIAH12pl54hy5mI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HheS0BAtY4UoNzWuPnQ9dTQEpN14FOHgzvEXrQiZAdRRtVj8cuLGBCT90ZfkJppxF w4BrmZyvyfPIJNWUIfOp1IvOu+Dm6EgvUq802sthDDkmiDNcuMI0rPgkdIFfy8BQds jdc6T5xJ+vP7U+1iSJRiU7lwRCeijBsotkpWlOwg= 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:02:55 +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 #8 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. As I can show this is not just about quadmath either. glibc's fminf/fmaxf h= as the same behavior there.=