summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1
diff options
context:
space:
mode:
authorRichard B. Kreckel <kreckel@ginac.de>2011-10-27 11:00:25 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-10-27 11:00:25 +0000
commit259f206328b3de4f4d35ffd22540ba2e75248646 (patch)
tree620e30a17939bf79786ab66334d4b0041cd8c78d /libstdc++-v3/include/tr1
parente7a7929d91e79912fc626ba178d8ee7bd68bed5e (diff)
downloadgcc-259f206328b3de4f4d35ffd22540ba2e75248646.tar.gz
re PR libstdc++/50880 (__complex_acosh() picks wrong complex branch)
2011-10-27 Richard B. Kreckel <kreckel@ginac.de> Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/50880 * include/std/complex (__complex_acosh): Fix for __z.real() < 0. * include/tr1/complex (__complex_acosh): Likewise. * testsuite/26_numerics/complex/50880.cc: New. * testsuite/tr1/8_c_compatibility/complex/50880.cc: Likewise. Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com> From-SVN: r180563
Diffstat (limited to 'libstdc++-v3/include/tr1')
-rw-r--r--libstdc++-v3/include/tr1/complex2
1 files changed, 2 insertions, 0 deletions
diff --git a/libstdc++-v3/include/tr1/complex b/libstdc++-v3/include/tr1/complex
index fc213b8f1d5..d29b13fe8b8 100644
--- a/libstdc++-v3/include/tr1/complex
+++ b/libstdc++-v3/include/tr1/complex
@@ -189,6 +189,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* (__z.real() + __z.imag()) - _Tp(1.0),
_Tp(2.0) * __z.real() * __z.imag());
__t = std::sqrt(__t);
+ if (__z.real() < _Tp(-0.0))
+ __t = -__t;
return std::log(__t + __z);
}