delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/09/01/13:00:29

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4A9D565B.3020103@gmail.com>
Date: Tue, 01 Sep 2009 18:14:03 +0100
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: std::arg() bug : not repetitive ?
References: <940968 DOT 31910 DOT qm AT web25508 DOT mail DOT ukl DOT yahoo DOT com>
In-Reply-To: <940968.31910.qm@web25508.mail.ukl.yahoo.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

Marco Atzeri wrote:
> Hi DaveK,
> the following test case on complex numbers 
> is producing, puzzling result on cygwin (both 1.5 and 1,7) 
> with gcc-4.3.2 (and also 3.4.4), while working on other platform:
> 
> #include <iostream>
> #include "oct-cmplx.h"
> 
> int main ()
> {
>   Complex z1 (1.0, 1.0), z2 (1.0, 1.0);
>   std::cout << (arg(z1)) << '\n';
>   std::cout << (arg(z2)) << '\n';
>   std::cout << (arg(z1)<arg(z2)) << '\n';
>   std::cout << (arg(z1)-arg(z2)) << '\n';
> }
> 
> 
> $ g++-4 comp_2.cc -o0 -o comp_2
> 
> $ ./comp_2
> 0.785398
> 0.785398
> 1
> -3.06287e-17    <<-- arg(1+i) is lower then arg(1+i) !!
> 
> Using different complex numbers is also possible to get 
> 
>   arg(-1-i) bigger then arg(-1-i)
> 
> Any idea what could cause it ? newlib ?

  Or maybe it's PR323 (excess precision) in some aspect.  Don't know yet, I'll
have to have a look into it.

    cheers,
      DaveK


--
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