delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/01/14:15:47

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 <marco_atzeri AT yahoo DOT it>
Subject: Re: std::arg() bug : not repetitive ?
To: cygwin AT cygwin DOT com, Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
In-Reply-To: <4A9D565B.3020103@gmail.com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019