This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::arg() bug : not repetitive ?


--- Mar 1/9/09, Dave Korn ha scritto:

> Da: Dave Korn 
> Oggetto: Re: std::arg()   bug : not repetitive ?
> A: cygwin cygwin.com
> Data: Martedì 1 settembre 2009, 19:14
> 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
> 

Dave,
thanks for the hint,
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323#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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]