public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/98201] CSQRT function gives bad resuts at runtime Date: Tue, 08 Dec 2020 15:55:59 +0000 [thread overview] Message-ID: <bug-98201-4-YMYq402Pjc@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-98201-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98201 --- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- What is the output of #include <complex.h> #include <stdio.h> int main() { _Complex float z, sq, sq2; int n; float a; a = -1.; for (n = 1; n < 10; n++) { a = a * 10; z = a + _Complex_I * 1.0; sq = csqrtf (z); sq2 = sq * sq; printf ("(%e,%e) (%e,%e) (%e,%e)\n", creal(z), cimag(z), creal(sq), cimag(sq), creal(sq2), cimag(sq2)); } return 0; } ? On my Linux box, it is (-1.000000e+01,1.000000e+00) (1.579171e-01,3.166218e+00) (-1.000000e+01,1.000000e+00) (-1.000000e+02,1.000000e+00) (4.999937e-02,1.000012e+01) (-1.000000e+02,1.000000e+00) (-1.000000e+03,1.000000e+00) (1.581139e-02,3.162278e+01) (-9.999999e+02,1.000000e+00) (-1.000000e+04,1.000000e+00) (5.000000e-03,1.000000e+02) (-1.000000e+04,1.000000e+00) (-1.000000e+05,1.000000e+00) (1.581139e-03,3.162278e+02) (-9.999999e+04,1.000000e+00) (-1.000000e+06,1.000000e+00) (5.000000e-04,1.000000e+03) (-1.000000e+06,1.000000e+00) (-1.000000e+07,1.000000e+00) (1.581139e-04,3.162278e+03) (-1.000000e+07,1.000000e+00) (-1.000000e+08,1.000000e+00) (5.000000e-05,1.000000e+04) (-1.000000e+08,1.000000e+00) (-1.000000e+09,1.000000e+00) (1.581139e-05,3.162278e+04) (-1.000000e+09,9.999999e-01)
next prev parent reply other threads:[~2020-12-08 15:55 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-08 14:44 [Bug fortran/98201] New: " pozar at ecs dot umass.edu 2020-12-08 15:34 ` [Bug fortran/98201] " tkoenig at gcc dot gnu.org 2020-12-08 15:35 ` dominiq at lps dot ens.fr 2020-12-08 15:47 ` dpozar at ecs dot umass.edu 2020-12-08 15:54 ` dpozar at ecs dot umass.edu 2020-12-08 15:55 ` tkoenig at gcc dot gnu.org [this message] 2020-12-08 16:27 ` dpozar at ecs dot umass.edu 2020-12-08 17:36 ` kargl at gcc dot gnu.org 2020-12-08 18:19 ` tkoenig at gcc dot gnu.org 2020-12-08 19:13 ` dpozar at ecs dot umass.edu 2020-12-08 19:27 ` tkoenig at gcc dot gnu.org 2020-12-08 20:46 ` dpozar at ecs dot umass.edu 2020-12-08 22:06 ` kargl at gcc dot gnu.org 2020-12-09 0:28 ` dpozar at ecs dot umass.edu 2020-12-09 4:38 ` sgk at troutmask dot apl.washington.edu 2020-12-09 13:24 ` dpozar at ecs dot umass.edu 2020-12-09 15:37 ` sgk at troutmask dot apl.washington.edu 2020-12-09 16:04 ` dpozar at ecs dot umass.edu 2021-03-28 12:38 ` dominiq at lps dot ens.fr 2021-03-28 13:05 ` dpozar at ecs dot umass.edu 2021-03-28 13:16 ` dominiq at lps dot ens.fr
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-98201-4-YMYq402Pjc@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.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).