complex (arg): Use std::signbit only when available.

2010-02-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/tr1_impl/complex (arg): Use std::signbit only when
	available.

From-SVN: r156972
This commit is contained in:
Paolo Carlini 2010-02-22 18:41:55 +00:00 committed by Paolo Carlini
parent 15d81a3c31
commit 26504a0f8c
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-02-22 Paolo Carlini <paolo.carlini@oracle.com>
* include/tr1_impl/complex (arg): Use std::signbit only when
available.
2010-02-22 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/functional_hash.h (hash<string>, hash<wstring>,

View File

@ -311,8 +311,12 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
arg(_Tp __x)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
#if (_GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC)
return std::signbit(__x) ? __type(3.1415926535897932384626433832795029L)
: __type();
#else
return std::arg(std::complex<__type>(__x));
#endif
}
template<typename _Tp>