public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
@ 2003-12-19 17:46 pkienzle at nist dot gov
2003-12-19 18:28 ` [Bug libstdc++/13450] " paolo at gcc dot gnu dot org
` (22 more replies)
0 siblings, 23 replies; 24+ messages in thread
From: pkienzle at nist dot gov @ 2003-12-19 17:46 UTC (permalink / raw)
To: gcc-bugs
In gcc/libstdc++-v3/std/std_complex.h between revision 1.5 and 1.6, the
definition of pow(cplx,real) was changed from:
return exp(__y * log(__x));
to:
if (__x.imag() == _Tp())
return pow(__x.real(), __y);
complex<_Tp> __t = log(__x);
return polar(exp(__y * __t.real()), __y * __t.imag());
It should be testing for negative numbers as well:
if (__x.imag() == _Tp() && __x.real() >= _Tp())
...
Similarly, pow(real,cplx) should also test for real<0.
Instead of:
return __x == _Tp()
? _Tp()
: polar(pow(__x, __y.real()), __y.imag() * log(__x));
use something like:
if (__x == _Tp())
return _Tp();
else if (__x > _Tp())
return polar(pow(__x, __y.real()), __y.imag() * log(__x));
else
return pow(complex<_Tp>(__x,_Tp()), __y);
The following program demonstrates the problem:
#include <cmath>
#include <iostream>
#include <complex>
using namespace std;
typedef double _Tp;
complex<_Tp> mypow(complex<_Tp> __x, _Tp __y)
{
if (__x.imag() == _Tp() && __x.real() >= _Tp())
return pow(__x.real(), __y);
complex<_Tp> __t = log(__x);
return polar(exp(__y * __t.real()), __y * __t.imag());
}
complex<_Tp> mypow(_Tp __x, complex<_Tp> __y)
{
if (__x == _Tp())
return _Tp();
else if (__x > _Tp())
return polar(pow(__x, __y.real()), __y.imag() * log(__x));
else
return pow(complex<_Tp>(__x,_Tp()),__y);
}
typedef complex<double> cplx;
void test(double a, double b)
{
cout << "a=" << a << ", b=" << b << endl;
cout << "pow(-cplx,cplx) =" << pow(cplx(a,0),cplx(b,0)) << endl;
cout << "pow(-real,cplx) =" << pow(a,cplx(b,0)) << endl;
cout << "pow(-cplx,real) =" << pow(cplx(a,0),b) << endl;
cout << "mypow(-real,cplx) =" << mypow(a,cplx(b,0)) << endl;
cout << "mypow(-cplx,real) =" << mypow(cplx(a,0),b) << endl;
}
int main(int argc, char *argv[])
{
test(0,0.5);
test(-1,0.5);
test(-3.2,1.4);
test(3.2,1.4);
return 0;
}
--
Summary: std::pow(std::complex<double>(-1.,0.),0.5) yields
(NaN,0)
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pkienzle at nist dot gov
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
@ 2003-12-19 18:28 ` paolo at gcc dot gnu dot org
2003-12-20 4:01 ` gdr at integrable-solutions dot net
` (21 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-12-19 18:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From paolo at gcc dot gnu dot org 2003-12-19 18:08 -------
Gaby, could you please have a look?
Thanks!
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |gdr at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
2003-12-19 18:28 ` [Bug libstdc++/13450] " paolo at gcc dot gnu dot org
@ 2003-12-20 4:01 ` gdr at integrable-solutions dot net
2004-01-11 4:42 ` gdr at integrable-solutions dot net
` (20 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-12-20 4:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2003-12-20 03:26 -------
Subject: Re: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
"paolo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Gaby, could you please have a look?
Yes.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
2003-12-19 18:28 ` [Bug libstdc++/13450] " paolo at gcc dot gnu dot org
2003-12-20 4:01 ` gdr at integrable-solutions dot net
@ 2004-01-11 4:42 ` gdr at integrable-solutions dot net
2004-01-11 10:07 ` paolo at gcc dot gnu dot org
` (19 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-01-11 4:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2004-01-11 04:42 -------
Subject: Re: New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
I'm not sure I see precisely what your problem is.
Can you describe it from the mathematical abstract point of view --
ignoring implementation details?
The branch cut for the first parameter is precisely the negative real
axis.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (2 preceding siblings ...)
2004-01-11 4:42 ` gdr at integrable-solutions dot net
@ 2004-01-11 10:07 ` paolo at gcc dot gnu dot org
2004-01-11 15:16 ` gdr at integrable-solutions dot net
` (18 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: paolo at gcc dot gnu dot org @ 2004-01-11 10:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From paolo at gcc dot gnu dot org 2004-01-11 10:07 -------
Hi everyone, hi Gaby. I'm attaching what I get with current mainline and
icc8 on x86. There are some differences:
9,10c9,10
< pow(-real,cplx) =(nan,nan)
< pow(-cplx,real) =(nan,0)
---
> pow(-real,cplx) =(nan,0)
> pow(-cplx,real) =(6.12303e-17,1)
15,16c15,16
< pow(-real,cplx) =(nan,nan)
< pow(-cplx,real) =(nan,0)
---
> pow(-real,cplx) =(nan,0)
> pow(-cplx,real) =(-1.57468,-4.84637)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (3 preceding siblings ...)
2004-01-11 10:07 ` paolo at gcc dot gnu dot org
@ 2004-01-11 15:16 ` gdr at integrable-solutions dot net
2004-01-11 16:41 ` paolo at gcc dot gnu dot org
` (17 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-01-11 15:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2004-01-11 15:16 -------
Subject: Re: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
"paolo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Hi everyone, hi Gaby. I'm attaching what I get with current mainline and
| icc8 on x86. There are some differences:
Thanks.
What I'm asking for is what the actual problem is. As I understand
it, the branch cut is on the negative real axis.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (4 preceding siblings ...)
2004-01-11 15:16 ` gdr at integrable-solutions dot net
@ 2004-01-11 16:41 ` paolo at gcc dot gnu dot org
2004-01-11 18:14 ` gdr at integrable-solutions dot net
` (16 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: paolo at gcc dot gnu dot org @ 2004-01-11 16:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From paolo at gcc dot gnu dot org 2004-01-11 16:41 -------
Well, after some years, my basic understanding of complex analysis is not so
good anymore... branch cuts... discontinuity... many values... Riemann sheets...
What's that? ;)
But, I must say, my friend Maple9.03 gives the same numbers of submitter's mypow,
for the concerned cases, that is (0, 1), (-1.57*, -4.84*)...
So...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (5 preceding siblings ...)
2004-01-11 16:41 ` paolo at gcc dot gnu dot org
@ 2004-01-11 18:14 ` gdr at integrable-solutions dot net
2004-01-11 18:57 ` paolo at gcc dot gnu dot org
` (15 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-01-11 18:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2004-01-11 18:14 -------
Subject: Re: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
OK, I see what is going wrong. But the submitter's patch is not right
either. To properly implement the branch cut, we need to test whether
the imaginary part is a positive or negative zero (on IEEE-754
plateform). Yes that is a crazy notion -- but we got it.
Therefore we need a primitive that tells the sign of a real number.
I just looked at the GCC built-ins and there does not seem to be one.
You can't just test for > or < 0. And == 0 tells whether it is zero,
it does not tell whether it is negative or positive zero.
Furthermore, this is a template code, so we need to come up with a
design that scales to templates. This probably means we ought to
compute the log() unconditionally -- but then, I don't recall why I
made the previous change in the first place.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (6 preceding siblings ...)
2004-01-11 18:14 ` gdr at integrable-solutions dot net
@ 2004-01-11 18:57 ` paolo at gcc dot gnu dot org
2004-01-11 19:38 ` gdr at integrable-solutions dot net
` (14 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: paolo at gcc dot gnu dot org @ 2004-01-11 18:57 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From paolo at gcc dot gnu dot org 2004-01-11 18:57 -------
> but then, I don't recall why I
> made the previous change in the first place.
;)
2003-05-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
PR libstdc++/10689
* include/std/std_complex.h (pow): Tidy.
Paolo.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (7 preceding siblings ...)
2004-01-11 18:57 ` paolo at gcc dot gnu dot org
@ 2004-01-11 19:38 ` gdr at integrable-solutions dot net
2004-01-12 16:07 ` pkienzle at nist dot gov
` (13 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-01-11 19:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2004-01-11 19:38 -------
Subject: Re: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
"paolo at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| > but then, I don't recall why I
| > made the previous change in the first place.
|
| ;)
|
| 2003-05-20 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
| PR libstdc++/10689
| * include/std/std_complex.h (pow): Tidy.
|
The joy of working in team; at least, one will have its brain in good
shape in order to keep the damaged ones working :-)
Thanks, Paolo.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (8 preceding siblings ...)
2004-01-11 19:38 ` gdr at integrable-solutions dot net
@ 2004-01-12 16:07 ` pkienzle at nist dot gov
2004-01-12 20:23 ` gdr at integrable-solutions dot net
` (12 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: pkienzle at nist dot gov @ 2004-01-12 16:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pkienzle at nist dot gov 2004-01-12 16:06 -------
(In reply to comment #9)
> OK, I see what is going wrong. But the submitter's patch is not right
> either. To properly implement the branch cut, we need to test whether
> the imaginary part is a positive or negative zero (on IEEE-754
> plateform). Yes that is a crazy notion -- but we got it.
For example, the following is calculated by Matlab on IRIX:
>> (-1+realmin*1i)^0.5
0.0000 + 1.0000i
>> (-1-realmin*1i)^0.5
0.0000 - 1.0000i
> Therefore we need a primitive that tells the sign of a real number.
C99 has signbit and copysign. I was able to access them as follows:
#include <iostream>
#include <cmath>
int main(int argc, char *argv[])
{
double x=1.0, y=-1.0, z;
std::cout << "1.0/HUGE_VAL=" << x/HUGE_VAL << std::endl;
std::cout << "signbit(1.0/HUGE_VAL)="
<< __gnu_cxx::signbit(x/HUGE_VAL) << std::endl;
std::cout << "-1.0/HUGE_VAL=" << y/HUGE_VAL << std::endl;
std::cout << "signbit(-1.0/HUGE_VAL)="
<< __gnu_cxx::signbit(y/HUGE_VAL) << std::endl;
return 0;
}
[prog]$ ./a.out
1.0/HUGE_VAL=0
signbit(1.0/HUGE_VAL)=0
-1.0/HUGE_VAL=-0
signbit(-1.0/HUGE_VAL)=-2147483648
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (9 preceding siblings ...)
2004-01-12 16:07 ` pkienzle at nist dot gov
@ 2004-01-12 20:23 ` gdr at integrable-solutions dot net
2004-03-03 2:20 ` [Bug libstdc++/13450] [3.3/3.4/3.5 Regression] " giovannibajo at libero dot it
` (11 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: gdr at integrable-solutions dot net @ 2004-01-12 20:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at integrable-solutions dot net 2004-01-12 20:23 -------
Subject: Re: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
"pkienzle at nist dot gov" <gcc-bugzilla@gcc.gnu.org> writes:
| > Therefore we need a primitive that tells the sign of a real number.
|
| C99 has signbit and copysign. I was able to access them as follows:
Yes, I know C99 has signbit and copysign, but that helps hardly for
this template code for C++.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3/3.4/3.5 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (10 preceding siblings ...)
2004-01-12 20:23 ` gdr at integrable-solutions dot net
@ 2004-03-03 2:20 ` giovannibajo at libero dot it
2004-03-10 9:16 ` cvs-commit at gcc dot gnu dot org
` (10 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: giovannibajo at libero dot it @ 2004-03-03 2:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From giovannibajo at libero dot it 2004-03-03 02:20 -------
This looks like a regression.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |3.3.3 3.4.0 3.5.0
Known to work| |3.2.3
Summary|std::pow(std::complex<double|[3.3/3.4/3.5 Regression]
|>(-1.,0.),0.5) yields |std::pow(std::complex<double
|(NaN,0) |>(-1.,0.),0.5) yields
| |(NaN,0)
Target Milestone|--- |3.3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3/3.4/3.5 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (11 preceding siblings ...)
2004-03-03 2:20 ` [Bug libstdc++/13450] [3.3/3.4/3.5 Regression] " giovannibajo at libero dot it
@ 2004-03-10 9:16 ` cvs-commit at gcc dot gnu dot org
2004-03-10 20:47 ` [Bug libstdc++/13450] [3.3/3.4 " andreas dot meier_ at gmx dot de
` (9 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-10 9:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-10 09:16 -------
Subject: Bug 13450
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: paolo@gcc.gnu.org 2004-03-10 09:16:12
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/include/std: std_complex.h
Added files:
libstdc++-v3/testsuite/26_numerics/complex: 13450.cc pow.cc
libstdc++-v3/testsuite/26_numerics/cmath: overloads.cc
Removed files:
libstdc++-v3/testsuite/26_numerics/complex: pow.C
libstdc++-v3/testsuite/26_numerics/cmath: overloads.C
Log message:
2004-03-10 Paul Kienzle <pkienzle@nist.gov>
Paolo Carlini <pcarlini@suse.de>
PR libstdc++/13450
* include/std/std_complex.h (pow(const complex&, const _Tp&),
pow(const _Tp&, const complex&)): Use cmath pow only when safe.
* testsuite/26_numerics/complex/13450.cc: New.
* testsuite/26_numerics/cmath/overloads.C: Rename to overloads.cc.
* testsuite/26_numerics/complex/pow.C: Rename to pow.cc and fix.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2392&r2=1.2393
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/std/std_complex.h.diff?cvsroot=gcc&r1=1.12&r2=1.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/complex/13450.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/complex/pow.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/complex/pow.C.diff?cvsroot=gcc&r1=1.2&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/cmath/overloads.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/cmath/overloads.C.diff?cvsroot=gcc&r1=1.1&r2=NONE
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3/3.4 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (12 preceding siblings ...)
2004-03-10 9:16 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-10 20:47 ` andreas dot meier_ at gmx dot de
2004-03-10 21:16 ` mmitchel at gcc dot gnu dot org
` (8 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: andreas dot meier_ at gmx dot de @ 2004-03-10 20:47 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From andreas dot meier_ at gmx dot de 2004-03-10 20:47 -------
What to do in the 3.4 branch?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mark at codesourcery dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3/3.4 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (13 preceding siblings ...)
2004-03-10 20:47 ` [Bug libstdc++/13450] [3.3/3.4 " andreas dot meier_ at gmx dot de
@ 2004-03-10 21:16 ` mmitchel at gcc dot gnu dot org
2004-03-10 22:21 ` pcarlini at suse dot de
` (7 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-03-10 21:16 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-03-10 21:16 -------
Apply the same patch to GCC 3.4 if the V3 people believe it to be safe.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3/3.4 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (14 preceding siblings ...)
2004-03-10 21:16 ` mmitchel at gcc dot gnu dot org
@ 2004-03-10 22:21 ` pcarlini at suse dot de
2004-03-11 18:33 ` cvs-commit at gcc dot gnu dot org
` (6 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: pcarlini at suse dot de @ 2004-03-10 22:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pcarlini at suse dot de 2004-03-10 22:21 -------
We believe so, but, to be 100% safe, we want to wait another 12 hr or so for a
full set of testresults on various platforms.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3/3.4 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (15 preceding siblings ...)
2004-03-10 22:21 ` pcarlini at suse dot de
@ 2004-03-11 18:33 ` cvs-commit at gcc dot gnu dot org
2004-04-08 3:15 ` [Bug libstdc++/13450] [3.3 " jlquinn at gcc dot gnu dot org
` (5 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-11 18:33 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-11 18:33 -------
Subject: Bug 13450
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: paolo@gcc.gnu.org 2004-03-11 18:33:36
Modified files:
libstdc++-v3 : ChangeLog
libstdc++-v3/include/std: std_complex.h
Added files:
libstdc++-v3/testsuite/26_numerics/complex: 13450.cc pow.cc
libstdc++-v3/testsuite/26_numerics/cmath: overloads.cc
Removed files:
libstdc++-v3/testsuite/26_numerics/complex: pow.C
libstdc++-v3/testsuite/26_numerics/cmath: overloads.C
Log message:
2004-03-11 Paul Kienzle <pkienzle@nist.gov>
Paolo Carlini <pcarlini@suse.de>
PR libstdc++/13450
* include/std/std_complex.h (pow(const complex&, const _Tp&),
pow(const _Tp&, const complex&)): Use cmath pow only when safe.
* testsuite/26_numerics/complex/13450.cc: New.
* testsuite/26_numerics/cmath/overloads.C: Rename to overloads.cc.
* testsuite/26_numerics/complex/pow.C: Rename to pow.cc and fix.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.60&r2=1.2224.2.61
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/std/std_complex.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.11.4.1&r2=1.11.4.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/complex/13450.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/complex/pow.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/complex/pow.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2&r2=NONE
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/cmath/overloads.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/26_numerics/cmath/overloads.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1&r2=NONE
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (16 preceding siblings ...)
2004-03-11 18:33 ` cvs-commit at gcc dot gnu dot org
@ 2004-04-08 3:15 ` jlquinn at gcc dot gnu dot org
2004-05-18 18:42 ` andreas dot meier_ at gmx dot de
` (4 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: jlquinn at gcc dot gnu dot org @ 2004-04-08 3:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jlquinn at gcc dot gnu dot org 2004-04-08 03:15 -------
There's a record of a patch here. Is it safe to close this bug?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pcarlini at suse dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (17 preceding siblings ...)
2004-04-08 3:15 ` [Bug libstdc++/13450] [3.3 " jlquinn at gcc dot gnu dot org
@ 2004-05-18 18:42 ` andreas dot meier_ at gmx dot de
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: andreas dot meier_ at gmx dot de @ 2004-05-18 18:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From andreas dot meier_ at gmx dot de 2004-05-18 05:30 -------
Can this patch go into 3.3.4?
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |gdr at integrable-solutions
| |dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (18 preceding siblings ...)
2004-05-18 18:42 ` andreas dot meier_ at gmx dot de
@ 2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
2004-08-08 19:46 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
22 siblings, 0 replies; 24+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-11 22:22 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.3.4 |3.3.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (19 preceding siblings ...)
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
@ 2004-08-08 19:46 ` cvs-commit at gcc dot gnu dot org
2004-09-28 13:24 ` gdr at gcc dot gnu dot org
2004-09-28 13:27 ` pinskia at gcc dot gnu dot org
22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-08 19:46 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-08-08 19:45 -------
Subject: Bug 13450
CVSROOT: /cvs/gcc
Module name: gcc
Branch: hammer-3_3-branch
Changes by: paolo@gcc.gnu.org 2004-08-08 19:45:56
Modified files:
libstdc++-v3 : ChangeLog.hammer
libstdc++-v3/include/std: std_complex.h
Log message:
2004-08-08 Paul Kienzle <pkienzle@nist.gov>
Paolo Carlini <pcarlini@suse.de>
PR libstdc++/13450
* include/std/std_complex.h (pow(const complex&, const _Tp&),
pow(const _Tp&, const complex&)): Use cmath pow only when safe.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.36&r2=1.1.2.37
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/std/std_complex.h.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.2.34.3&r2=1.2.34.4
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (20 preceding siblings ...)
2004-08-08 19:46 ` cvs-commit at gcc dot gnu dot org
@ 2004-09-28 13:24 ` gdr at gcc dot gnu dot org
2004-09-28 13:27 ` pinskia at gcc dot gnu dot org
22 siblings, 0 replies; 24+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-09-28 13:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at gcc dot gnu dot org 2004-09-28 13:24 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|3.3.5 |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
* [Bug libstdc++/13450] [3.3 Regression] std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0)
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
` (21 preceding siblings ...)
2004-09-28 13:24 ` gdr at gcc dot gnu dot org
@ 2004-09-28 13:27 ` pinskia at gcc dot gnu dot org
22 siblings, 0 replies; 24+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-28 13:27 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.0 |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13450
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2004-09-28 13:27 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-19 17:46 [Bug libstdc++/13450] New: std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0) pkienzle at nist dot gov
2003-12-19 18:28 ` [Bug libstdc++/13450] " paolo at gcc dot gnu dot org
2003-12-20 4:01 ` gdr at integrable-solutions dot net
2004-01-11 4:42 ` gdr at integrable-solutions dot net
2004-01-11 10:07 ` paolo at gcc dot gnu dot org
2004-01-11 15:16 ` gdr at integrable-solutions dot net
2004-01-11 16:41 ` paolo at gcc dot gnu dot org
2004-01-11 18:14 ` gdr at integrable-solutions dot net
2004-01-11 18:57 ` paolo at gcc dot gnu dot org
2004-01-11 19:38 ` gdr at integrable-solutions dot net
2004-01-12 16:07 ` pkienzle at nist dot gov
2004-01-12 20:23 ` gdr at integrable-solutions dot net
2004-03-03 2:20 ` [Bug libstdc++/13450] [3.3/3.4/3.5 Regression] " giovannibajo at libero dot it
2004-03-10 9:16 ` cvs-commit at gcc dot gnu dot org
2004-03-10 20:47 ` [Bug libstdc++/13450] [3.3/3.4 " andreas dot meier_ at gmx dot de
2004-03-10 21:16 ` mmitchel at gcc dot gnu dot org
2004-03-10 22:21 ` pcarlini at suse dot de
2004-03-11 18:33 ` cvs-commit at gcc dot gnu dot org
2004-04-08 3:15 ` [Bug libstdc++/13450] [3.3 " jlquinn at gcc dot gnu dot org
2004-05-18 18:42 ` andreas dot meier_ at gmx dot de
2004-06-11 22:22 ` pinskia at gcc dot gnu dot org
2004-08-08 19:46 ` cvs-commit at gcc dot gnu dot org
2004-09-28 13:24 ` gdr at gcc dot gnu dot org
2004-09-28 13:27 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).