public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kretz at kde dot org" <sourceware-bugzilla@sourceware.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 [thread overview] Message-ID: <bug-27460-131@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=27460 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 <fenv.h> #include <math.h> int main() { volatile double a = __DBL_DENORM_MIN__; volatile double c = -0.; feclearexcept(FE_ALL_EXCEPT); //c = hypot(a, c); // this argument order raises no exceptions c = hypot(c, a); return fetestexcept(FE_ALL_EXCEPT); } This program raises FE_INEXACT and FE_UNDERFLOW. Since one argument to hypot is 0 the result is exact: the absolute value of the other argument. If you switch the argument order the program raises no floating-point exceptions. -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2021-02-23 16:07 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-23 16:07 kretz at kde dot org [this message] 2021-02-23 16:07 ` [Bug math/27460] " kretz at kde dot org 2021-02-23 20:13 ` adhemerval.zanella at linaro dot org 2021-02-23 20:20 ` kretz at kde dot org 2021-02-23 20:37 ` adhemerval.zanella at linaro dot org 2021-02-23 20:46 ` kretz at kde dot org 2021-02-23 20:54 ` joseph at codesourcery dot com 2021-02-23 21:06 ` kretz at kde dot org 2021-02-24 13:32 ` adhemerval.zanella at linaro dot org 2021-02-24 22:48 ` joseph at codesourcery dot com 2021-04-08 4:38 ` zimmerma+gcc at loria dot fr 2021-04-08 10:34 ` adhemerval.zanella at linaro dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-27460-131@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).