Commit c6feb697 by Paolo Carlini Committed by Paolo Carlini

std_complex.h (pow(const complex&, const _Tp&), [...]): Fully qualify with std:: a few calls.

2004-03-11  Paolo Carlini  <pcarlini@suse.de>

	* include/std/std_complex.h (pow(const complex&, const _Tp&),
	pow(const _Tp&, const complex&), pow(const complex&,
	const complex&)): Fully qualify with std:: a few calls.
	* testsuite/26_numerics/complex/13450.cc: Minor tweak.

From-SVN: r79338
parent 878cbb73
2004-03-11 Paolo Carlini <pcarlini@suse.de>
* include/std/std_complex.h (pow(const complex&, const _Tp&),
pow(const _Tp&, const complex&), pow(const complex&,
const complex&)): Fully qualify with std:: a few calls.
* testsuite/26_numerics/complex/13450.cc: Minor tweak.
2004-03-11 Steven Bosscher <s.bosscher@student.tudelft.nl> 2004-03-11 Steven Bosscher <s.bosscher@student.tudelft.nl>
PR libstdc++/11706 PR libstdc++/11706
......
...@@ -708,7 +708,7 @@ namespace std ...@@ -708,7 +708,7 @@ namespace std
if (__x.imag() == _Tp() && __x.real() > _Tp()) if (__x.imag() == _Tp() && __x.real() > _Tp())
return pow(__x.real(), __y); return pow(__x.real(), __y);
complex<_Tp> __t = log(__x); complex<_Tp> __t = std::log(__x);
return std::polar(exp(__y * __t.real()), __y * __t.imag()); return std::polar(exp(__y * __t.real()), __y * __t.imag());
} }
...@@ -716,15 +716,16 @@ namespace std ...@@ -716,15 +716,16 @@ namespace std
inline complex<_Tp> inline complex<_Tp>
pow(const complex<_Tp>& __x, const complex<_Tp>& __y) pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ {
return __x == _Tp() ? _Tp() : exp(__y * log(__x)); return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x));
} }
template<typename _Tp> template<typename _Tp>
inline complex<_Tp> inline complex<_Tp>
pow(const _Tp& __x, const complex<_Tp>& __y) pow(const _Tp& __x, const complex<_Tp>& __y)
{ {
return __x > _Tp() ? polar(pow(__x, __y.real()), __y.imag() * log(__x)) return __x > _Tp() ? std::polar(pow(__x, __y.real()),
: pow(complex<_Tp>(__x, _Tp()), __y); __y.imag() * log(__x))
: std::pow(complex<_Tp>(__x, _Tp()), __y);
} }
// 26.2.3 complex specializations // 26.2.3 complex specializations
......
...@@ -29,7 +29,7 @@ template<typename T> ...@@ -29,7 +29,7 @@ template<typename T>
bool test __attribute__((unused)) = true; bool test __attribute__((unused)) = true;
typedef complex<T> cplx; typedef complex<T> cplx;
T eps = numeric_limits<T>::epsilon() * 10; T eps = numeric_limits<T>::epsilon() * 100;
cplx ref = pow(cplx(a, T()), cplx(b, T())); cplx ref = pow(cplx(a, T()), cplx(b, T()));
cplx res1 = pow(a, cplx(b, T())); cplx res1 = pow(a, cplx(b, T()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment