X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <264058.8230.qm@web25502.mail.ukl.yahoo.com> Date: Tue, 1 Sep 2009 18:15:34 +0000 (GMT) From: Marco Atzeri Subject: Re: std::arg() bug : not repetitive ? To: cygwin AT cygwin DOT com, Dave Korn In-Reply-To: <4A9D565B.3020103@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --- 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 > > #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) >=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