OSDN Git Service

2010-02-22 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Feb 2010 18:41:55 +0000 (18:41 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 22 Feb 2010 18:41:55 +0000 (18:41 +0000)
* include/tr1_impl/complex (arg): Use std::signbit only when
available.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156972 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/tr1_impl/complex

index 664f57d..d60096a 100644 (file)
@@ -1,5 +1,10 @@
 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>,
        hash<u16string>, hash<u32string>, hash<error_code>): Move, per
        DR 1182 to...
index ac420bf..aae4a13 100644 (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>