diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-05 20:44:17 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-05 20:44:17 +0000 |
| commit | 9927a5716b561737bf2e2c8c3c288e235217cdff (patch) | |
| tree | 2a58292f317955044ba513cefef345dc295739c7 /libstdc++-v3/include/std/std_complex.h | |
| parent | f62378f40b5338f275f93ce490907843d3d769ae (diff) | |
| download | ppe42-gcc-9927a5716b561737bf2e2c8c3c288e235217cdff.tar.gz ppe42-gcc-9927a5716b561737bf2e2c8c3c288e235217cdff.zip | |
2003-07-05 Paolo Carlini <pcarlini@unitus.it>
* include/std/std_complex.h: Fully qualify standard
functions with std::, thus avoiding Koenig lookup.
* include/std/std_memory.h: Likewise.
* include/std/std_valarray.h: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68982 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/std_complex.h')
| -rw-r--r-- | libstdc++-v3/include/std/std_complex.h | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/libstdc++-v3/include/std/std_complex.h b/libstdc++-v3/include/std/std_complex.h index 97d764df96b..fe7dd22f008 100644 --- a/libstdc++-v3/include/std/std_complex.h +++ b/libstdc++-v3/include/std/std_complex.h @@ -243,7 +243,7 @@ namespace std complex<_Tp>::operator/=(const complex<_Up>& __z) { const _Tp __r = _M_real * __z.real() + _M_imag * __z.imag(); - const _Tp __n = norm(__z); + const _Tp __n = std::norm(__z); _M_imag = (_M_imag * __z.real() - _M_real * __z.imag()) / __n; _M_real = __r / __n; return *this; @@ -411,18 +411,18 @@ namespace std { _Tp __x = __z.real(); _Tp __y = __z.imag(); - const _Tp __s = std::max(abs(__x), abs(__y)); + const _Tp __s = std::max(std::abs(__x), std::abs(__y)); if (__s == _Tp()) // well ... return __s; __x /= __s; __y /= __s; - return __s * sqrt(__x * __x + __y * __y); + return __s * std::sqrt(__x * __x + __y * __y); } template<typename _Tp> inline _Tp arg(const complex<_Tp>& __z) - { return atan2(__z.imag(), __z.real()); } + { return std::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 @@ -447,7 +447,7 @@ namespace std template<typename _Tp> static inline _Tp _S_do_it(const complex<_Tp>& __z) { - _Tp __res = abs(__z); + _Tp __res = std::abs(__z); return __res * __res; } }; @@ -462,7 +462,7 @@ namespace std template<typename _Tp> inline complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta) - { return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta)); } + { return complex<_Tp>(__rho * std::cos(__theta), __rho * std::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>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y)); + return complex<_Tp>(std::cos(__x) * std::cosh(__y), -std::sin(__x) * std::sinh(__y)); } template<typename _Tp> @@ -485,23 +485,23 @@ namespace std { const _Tp __x = __z.real(); const _Tp __y = __z.imag(); - return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y)); + return complex<_Tp>(std::cosh(__x) * std::cos(__y), std::sinh(__x) * std::sin(__y)); } template<typename _Tp> inline complex<_Tp> exp(const complex<_Tp>& __z) - { return polar(exp(__z.real()), __z.imag()); } + { return std::polar(std::exp(__z.real()), __z.imag()); } template<typename _Tp> inline complex<_Tp> log(const complex<_Tp>& __z) - { return complex<_Tp>(log(abs(__z)), arg(__z)); } + { return complex<_Tp>(std::log(std::abs(__z)), std::arg(__z)); } template<typename _Tp> inline complex<_Tp> log10(const complex<_Tp>& __z) - { return log(__z) / log(_Tp(10.0)); } + { return std::log(__z) / std::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>(sin(__x) * cosh(__y), cos(__x) * sinh(__y)); + return complex<_Tp>(std::sin(__x) * std::cosh(__y), std::cos(__x) * std::sinh(__y)); } template<typename _Tp> @@ -518,7 +518,7 @@ namespace std { const _Tp __x = __z.real(); const _Tp __y = __z.imag(); - return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y)); + return complex<_Tp>(std::sinh(__x) * std::cos(__y), std::cosh(__x) * std::sin(__y)); } template<typename _Tp> @@ -530,16 +530,16 @@ namespace std if (__x == _Tp()) { - _Tp __t = sqrt(abs(__y) / 2); + _Tp __t = std::sqrt(std::abs(__y) / 2); return complex<_Tp>(__t, __y < _Tp() ? -__t : __t); } else { - _Tp __t = sqrt(2 * (abs(__z) + abs(__x))); + _Tp __t = std::sqrt(2 * (std::abs(__z) + std::abs(__x))); _Tp __u = __t / 2; return __x > _Tp() ? complex<_Tp>(__u, __y / __t) - : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u); + : complex<_Tp>(std::abs(__y) / __t, __y < _Tp() ? -__u : __u); } } @@ -547,21 +547,21 @@ namespace std inline complex<_Tp> tan(const complex<_Tp>& __z) { - return sin(__z) / cos(__z); + return std::sin(__z) / std::cos(__z); } template<typename _Tp> inline complex<_Tp> tanh(const complex<_Tp>& __z) { - return sinh(__z) / cosh(__z); + return std::sinh(__z) / std::cosh(__z); } template<typename _Tp> inline complex<_Tp> pow(const complex<_Tp>& __z, int __n) { - return __pow_helper(__z, __n); + return std::__pow_helper(__z, __n); } template<typename _Tp> @@ -569,17 +569,17 @@ namespace std pow(const complex<_Tp>& __x, const _Tp& __y) { if (__x.imag() == _Tp()) - return pow(__x.real(), __y); + return std::pow(__x.real(), __y); - complex<_Tp> __t = log(__x); - return polar(exp(__y * __t.real()), __y * __t.imag()); + complex<_Tp> __t = std::log(__x); + return std::polar(std::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() : exp(__y * log(__x)); + return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); } template<typename _Tp> @@ -588,7 +588,7 @@ namespace std { return __x == _Tp() ? _Tp() - : polar(pow(__x, __y.real()), __y.imag() * log(__x)); + : std::polar(std::pow(__x, __y.real()), __y.imag() * std::log(__x)); } // 26.2.3 complex specializations |

