X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <539319.41328.qm@web25002.mail.ukl.yahoo.com>
Date: Wed, 1 Apr 2009 17:04:42 +0000 (GMT)
From: Marco Atzeri <marco_atzeri@yahoo.it>
Subject: Re: complex number
To: cygwin@cygwin.com, Greg Chicares <gchicares@sbcglobal.net>
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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com




--- Mer 1/4/09, Greg Chicares  ha scritto:

> Da: Greg Chicares=20
> Oggetto: Re: complex number
> A: cygwin@cygwin.com
> Data: Mercoled=EC 1 Aprile 2009, 17:32
> On 2009-04-01 14:48Z, Marco Atzeri
> wrote:
> >
> > I was trying to understand why this code
> >=20
> > #include <iostream>
> > #include <complex>
> >=20
> > int main()
> > {
> >=A0=A0=A0double a =3D 0;
> >=A0=A0=A0double b =3D 1. / a;
> >=A0=A0=A0a +=3D 1;
> >=A0=A0=A0std::cout << std::abs
> (std::complex<double> (b, a)) << '\n';
> >=A0 }
> >=20
> > produce Inf on most platform and NaN on cygwin.
>=20
> As I read C++2003 26.2/3, this use of std::abs has
> undefined
> behavior, so NaN would be conforming even though Inf would
> be less surprising.
>=20
>=20

you could be right but, I expect that gcc-4.3.2 work=20
in similar way in linux and cygwin, so a call to cabs.
In newlib cabs is wrapper for hypot and=20
hypot (0, Inf) gives Inf=20

Regards
Marco





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

