std_complex.h: Partially revert last changes: cmath functions must not be qualified.

2003-07-07  Paolo Carlini  <pcarlini@unitus.it>

	* include/std/std_complex.h: Partially revert last
	changes: cmath functions must not be qualified.

From-SVN: r69040
This commit is contained in:
Paolo Carlini 2003-07-07 14:15:00 +02:00 committed by Paolo Carlini
parent e61a2eb776
commit a8784c4c8f
2 changed files with 24 additions and 19 deletions

View File

@ -1,3 +1,8 @@
2003-07-07 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_complex.h: Partially revert last
changes: cmath functions must not be qualified.
2003-07-06 Phil Edwards <pme@gcc.gnu.org>
* acinclude.m4 (GLIBCXX_ENABLE_SYMVERS): Do not test for binutils

View File

@ -411,18 +411,18 @@ namespace std
{
_Tp __x = __z.real();
_Tp __y = __z.imag();
const _Tp __s = std::max(std::abs(__x), std::abs(__y));
const _Tp __s = std::max(abs(__x), abs(__y));
if (__s == _Tp()) // well ...
return __s;
__x /= __s;
__y /= __s;
return __s * std::sqrt(__x * __x + __y * __y);
return __s * sqrt(__x * __x + __y * __y);
}
template<typename _Tp>
inline _Tp
arg(const complex<_Tp>& __z)
{ return std::atan2(__z.imag(), __z.real()); }
{ return atan2(__z.imag(), __z.real()); }
// 26.2.7/5: norm(__z) returns the squared magintude of __z.
// As defined, norm() is -not- a norm is the common mathematical
@ -462,7 +462,7 @@ namespace std
template<typename _Tp>
inline complex<_Tp>
polar(const _Tp& __rho, const _Tp& __theta)
{ return complex<_Tp>(__rho * std::cos(__theta), __rho * std::sin(__theta)); }
{ return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); }
template<typename _Tp>
inline complex<_Tp>
@ -476,7 +476,7 @@ namespace std
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(std::cos(__x) * std::cosh(__y), -std::sin(__x) * std::sinh(__y));
return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
}
template<typename _Tp>
@ -485,23 +485,23 @@ namespace std
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(std::cosh(__x) * std::cos(__y), std::sinh(__x) * std::sin(__y));
return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
}
template<typename _Tp>
inline complex<_Tp>
exp(const complex<_Tp>& __z)
{ return std::polar(std::exp(__z.real()), __z.imag()); }
{ return std::polar(exp(__z.real()), __z.imag()); }
template<typename _Tp>
inline complex<_Tp>
log(const complex<_Tp>& __z)
{ return complex<_Tp>(std::log(std::abs(__z)), std::arg(__z)); }
{ return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
template<typename _Tp>
inline complex<_Tp>
log10(const complex<_Tp>& __z)
{ return std::log(__z) / std::log(_Tp(10.0)); }
{ return std::log(__z) / log(_Tp(10.0)); }
template<typename _Tp>
inline complex<_Tp>
@ -509,7 +509,7 @@ namespace std
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(std::sin(__x) * std::cosh(__y), std::cos(__x) * std::sinh(__y));
return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
}
template<typename _Tp>
@ -518,7 +518,7 @@ namespace std
{
const _Tp __x = __z.real();
const _Tp __y = __z.imag();
return complex<_Tp>(std::sinh(__x) * std::cos(__y), std::cosh(__x) * std::sin(__y));
return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
}
template<typename _Tp>
@ -530,16 +530,16 @@ namespace std
if (__x == _Tp())
{
_Tp __t = std::sqrt(std::abs(__y) / 2);
_Tp __t = sqrt(abs(__y) / 2);
return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
}
else
{
_Tp __t = std::sqrt(2 * (std::abs(__z) + std::abs(__x)));
_Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
_Tp __u = __t / 2;
return __x > _Tp()
? complex<_Tp>(__u, __y / __t)
: complex<_Tp>(std::abs(__y) / __t, __y < _Tp() ? -__u : __u);
: complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
}
}
@ -569,17 +569,17 @@ namespace std
pow(const complex<_Tp>& __x, const _Tp& __y)
{
if (__x.imag() == _Tp())
return std::pow(__x.real(), __y);
return pow(__x.real(), __y);
complex<_Tp> __t = std::log(__x);
return std::polar(std::exp(__y * __t.real()), __y * __t.imag());
complex<_Tp> __t = log(__x);
return std::polar(exp(__y * __t.real()), __y * __t.imag());
}
template<typename _Tp>
inline complex<_Tp>
pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{
return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x));
return __x == _Tp() ? _Tp() : exp(__y * log(__x));
}
template<typename _Tp>
@ -588,7 +588,7 @@ namespace std
{
return __x == _Tp()
? _Tp()
: std::polar(std::pow(__x, __y.real()), __y.imag() * std::log(__x));
: std::polar(pow(__x, __y.real()), __y.imag() * log(__x));
}
// 26.2.3 complex specializations