From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ED22F3854838; Tue, 23 Feb 2021 16:07:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ED22F3854838 From: "kretz at kde dot org" To: glibc-bugs@sourceware.org Subject: [Bug math/27460] New: hypot(__DBL_DENORM_MIN__, -0.) incorrectly raises FE_INEXACT and FE_UNDERFLOW Date: Tue, 23 Feb 2021 16:07:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: math X-Bugzilla-Version: 2.31 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kretz at kde dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2021 16:07:30 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27460 Bug ID: 27460 Summary: hypot(__DBL_DENORM_MIN__, -0.) incorrectly raises FE_INEXACT and FE_UNDERFLOW Product: glibc Version: 2.31 Status: UNCONFIRMED Severity: normal Priority: P2 Component: math Assignee: unassigned at sourceware dot org Reporter: kretz at kde dot org Target Milestone: --- Testcase (https://godbolt.org/z/b4Ko4Y): #include #include int main() { volatile double a =3D __DBL_DENORM_MIN__; volatile double c =3D -0.; feclearexcept(FE_ALL_EXCEPT); //c =3D hypot(a, c); // this argument order raises no exceptions c =3D hypot(c, a); return fetestexcept(FE_ALL_EXCEPT); } This program raises FE_INEXACT and FE_UNDERFLOW. Since one argument to hypo= t is 0 the result is exact: the absolute value of the other argument. If you swi= tch the argument order the program raises no floating-point exceptions. --=20 You are receiving this mail because: You are on the CC list for the bug.=