Mail Archives: cygwin/2009/09/01/14:15:47
--- Mar 1/9/09, Dave Korn ha scritto:
> Da: Dave Korn=20
> Oggetto: Re: std::arg() bug : not repetitive ?
> A: cygwin cygwin.com
> Data: Marted=EC 1 settembre 2009, 19:14
> Marco Atzeri wrote:
> > Hi DaveK,
> > the following test case on complex numbers=20
> > is producing, puzzling result on cygwin (both 1.5 and
> 1,7)=20
> > with gcc-4.3.2 (and also 3.4.4), while working on
> other platform:
> >=20
> > #include <iostream>
> > #include "oct-cmplx.h"
> >=20
> > int main ()
> > {
> >=A0=A0=A0Complex z1 (1.0, 1.0), z2 (1.0,
> 1.0);
> >=A0=A0=A0std::cout << (arg(z1)) <<
> '\n';
> >=A0=A0=A0std::cout << (arg(z2)) <<
> '\n';
> >=A0=A0=A0std::cout <<
> (arg(z1)<arg(z2)) << '\n';
> >=A0=A0=A0std::cout << (arg(z1)-arg(z2))
> << '\n';
> > }
> >=20
> >=20
> > $ g++-4 comp_2.cc -o0 -o comp_2
> >=20
> > $ ./comp_2
> > 0.785398
> > 0.785398
> > 1
> > -3.06287e-17=A0 =A0 <<-- arg(1+i) is lower
> then arg(1+i) !!
> >=20
> > Using different complex numbers is also possible to
> get=20
> >=20
> >=A0=A0=A0arg(-1-i) bigger then arg(-1-i)
> >=20
> > Any idea what could cause it ? newlib ?
>=20
> =A0 Or maybe it's PR323 (excess precision) in some
> aspect.=A0 Don't know yet, I'll
> have to have a look into it.
>=20
> =A0 =A0 cheers,
> =A0 =A0 =A0 DaveK
>=20
Dave,
thanks for the hint,
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D323#c2
$g++-4 -ffloat-store comp_2.cc -O3 -o comp_4
./comp_4
0.785398
0.785398
0
0
Regards
Marco
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -