From decf0e27a018bd3c5fafee44c5f6aead8fc8cc9c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 1 Oct 2012 23:10:02 +0000 Subject: re PR libstdc++/54757 (FAIL: ext/random/beta_distribution/cons/default.cc (test for excess errors)) 2012-10-01 Paolo Carlini 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/include/ext/random | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libstdc++-v3/include/ext/random') diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random index 884e8a0..8c40d6d 100644 --- a/libstdc++-v3/include/ext/random +++ b/libstdc++-v3/include/ext/random @@ -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 @@ -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