]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/54757 (FAIL: ext/random/beta_distribution/cons/default.cc (test for...
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 1 Oct 2012 23:10:02 +0000 (23:10 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 1 Oct 2012 23:10:02 +0000 (23:10 +0000)
2012-10-01  Paolo Carlini  <paolo.carlini@oracle.com>

PR libstdc++/54757
* include/ext/random (rice_distribution<>::operator()): Use std::hypot
only if _GLIBCXX_USE_C99_MATH_TR1.
* include/ext/random.tcc (rice_distribution<>::__generate_impl):
Likewise.

From-SVN: r191944

libstdc++-v3/ChangeLog
libstdc++-v3/include/ext/random
libstdc++-v3/include/ext/random.tcc

index 8fd82e7ab6666cbe6a92126f6c62a3417a080c48..8eb1480809534a03199126689aeab602e8b47e46 100644 (file)
@@ -1,3 +1,11 @@
+2012-10-01  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR libstdc++/54757
+       * include/ext/random (rice_distribution<>::operator()): Use std::hypot
+       only if _GLIBCXX_USE_C99_MATH_TR1.
+       * include/ext/random.tcc (rice_distribution<>::__generate_impl):
+       Likewise.
+
 2012-10-01  Daniel Krugler  <daniel.kruegler@googlemail.com>
 
        * include/std/type_traits (result_of): Provide "SFINAE-friendly"
index 884e8a0ca91d30a87abba3d8948a45de71a42bdb..8c40d6d420ad746342281253a2c57dbd7ef6b0db 100644 (file)
@@ -1042,7 +1042,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        {
          result_type __x = this->_M_ndx(__urng);
          result_type __y = this->_M_ndy(__urng);
+#if _GLIBCXX_USE_C99_MATH_TR1
          return std::hypot(__x, __y);
+#else
+         return std::sqrt(__x * __x + __y * __y);
+#endif
        }
 
       template<typename _UniformRandomNumberGenerator>
@@ -1054,7 +1058,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
            __px(__p.nu(), __p.sigma()), __py(result_type(0), __p.sigma());
          result_type __x = this->_M_ndx(__px, __urng);
          result_type __y = this->_M_ndy(__py, __urng);
+#if _GLIBCXX_USE_C99_MATH_TR1
          return std::hypot(__x, __y);
+#else
+         return std::sqrt(__x * __x + __y * __y);
+#endif
        }
 
       template<typename _ForwardIterator,
index 86bb67fedf9155f4574fa2accc0f420ae1ac20c0..4151daff83d05bdd4d7aff20ca966f6edf347b2f 100644 (file)
@@ -732,7 +732,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
              __px(__p.nu(), __p.sigma()), __py(result_type(0), __p.sigma());
            result_type __x = this->_M_ndx(__px, __urng);
            result_type __y = this->_M_ndy(__py, __urng);
+#if _GLIBCXX_USE_C99_MATH_TR1
            *__f++ = std::hypot(__x, __y);
+#else
+           *__f++ = std::sqrt(__x * __x + __y * __y);
+#endif
          }
       }