From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DBD383890419; Tue, 23 Feb 2021 20:13:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBD383890419 From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug math/27460] hypot(__DBL_DENORM_MIN__, -0.) incorrectly raises FE_INEXACT and FE_UNDERFLOW Date: Tue, 23 Feb 2021 20:13:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: adhemerval.zanella at linaro 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: cc Message-ID: In-Reply-To: References: 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 20:13:26 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27460 Adhemerval Zanella changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adhemerval.zanella at lina= ro dot o | |rg --- Comment #1 from Adhemerval Zanella --- Afaik since we define __STDC_IEC_559__ POSIX allows the implementation to return an error range [1]. This is in fact what the fix for BZ#18803 does, where it explicit raise underflow exception when the result is tiny and inexact. I think we are in fact missing a underflow check for the case where second argument is '0': diff --git a/sysdeps/ieee754/dbl-64/e_hypot.c b/sysdeps/ieee754/dbl-64/e_hypot.c index 9ec4c1ced0..bcd172130e 100644 --- a/sysdeps/ieee754/dbl-64/e_hypot.c +++ b/sysdeps/ieee754/dbl-64/e_hypot.c @@ -100,7 +100,10 @@ __ieee754_hypot (double x, double y) uint32_t low; GET_LOW_WORD (low, b); if ((hb | low) =3D=3D 0) - return a; + { + math_check_force_underflow (x); + return a; + } t1 =3D 0; SET_HIGH_WORD (t1, 0x7fd00000); /* t1=3D2^1022 */ b *=3D t1; [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/hypot.html --=20 You are receiving this mail because: You are on the CC list for the bug.=