[Bug fortran/98201] CSQRT function gives bad resuts at runtime
dpozar at ecs dot umass.edu
gcc-bugzilla@gcc.gnu.org
Tue Dec 8 16:27:24 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98201
--- Comment #6 from dpozar at ecs dot umass.edu ---
Thomas,
I am running that code in code blocks with MS visual C++ 2010, but I can't find
the output - no console screen, and no output file that I can find.
dave
________________________________
From: tkoenig at gcc dot gnu.org <gcc-bugzilla@gcc.gnu.org>
Sent: Tuesday, December 8, 2020 10:55 AM
To: David Pozar <dpozar@ecs.umass.edu>
Subject: [Bug fortran/98201] CSQRT function gives bad resuts at runtime
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)
--
You are receiving this mail because:
You reported the bug.
More information about the Gcc-bugs
mailing list