From 72f47ffea0536ad5aa38bc5395d3eee959d8002c Mon Sep 17 00:00:00 2001 From: Adrien Destugues - PulkoMandy Date: Sat, 27 Oct 2012 15:42:44 +0200 Subject: [PATCH] Add missing tan(), tanh() and log10() for std::complex. These are part of the C++ standard, I don't know how they went missing in our version. http://www.cplusplus.com/reference/std/complex/ They are needed to build MathGL library, and likely other stuff. --- legacy/gcc/libstdc++/std/complext.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/legacy/gcc/libstdc++/std/complext.h b/legacy/gcc/libstdc++/std/complext.h index 6c55037bf9..0e70194780 100644 --- a/legacy/gcc/libstdc++/std/complext.h +++ b/legacy/gcc/libstdc++/std/complext.h @@ -311,7 +311,7 @@ operator != (_FLT x, const complex<_FLT>& y) } // Some targets don't provide a prototype for hypot when -ansi. -extern "C" double hypot (double, double) __attribute__ ((const)); +//extern "C" double hypot (double, double) __attribute__ ((const)); template inline _FLT abs (const complex<_FLT>& x) __attribute__ ((const)); @@ -387,6 +387,22 @@ template complex<_FLT> template complex<_FLT> sqrt (const complex<_FLT>&) __attribute__ ((const)); +template inline complex<_FLT> +tan (const complex<_FLT>& x) +{ + return sin (x) / cos (x); +} +template inline complex<_FLT> +tanh (const complex<_FLT>& x) +{ + return sinh (x) / cosh (x); +} +template inline complex<_FLT> +log10 (const complex<_FLT>& x) +{ + return log (x) / log (10.0); +} + template istream& operator >> (istream&, complex<_FLT>&); template ostream& operator << (ostream&, const complex<_FLT>&); } // extern "C++"