mirror of
https://review.haiku-os.org/buildtools
synced 2024-11-23 07:18:49 +01:00
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.
This commit is contained in:
parent
87efb055fb
commit
855732f929
@ -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 <class _FLT> inline _FLT
|
||||
abs (const complex<_FLT>& x) __attribute__ ((const));
|
||||
@ -387,6 +387,22 @@ template <class _FLT> complex<_FLT>
|
||||
template <class _FLT> complex<_FLT>
|
||||
sqrt (const complex<_FLT>&) __attribute__ ((const));
|
||||
|
||||
template <class _FLT> inline complex<_FLT>
|
||||
tan (const complex<_FLT>& x)
|
||||
{
|
||||
return sin (x) / cos (x);
|
||||
}
|
||||
template <class _FLT> inline complex<_FLT>
|
||||
tanh (const complex<_FLT>& x)
|
||||
{
|
||||
return sinh (x) / cosh (x);
|
||||
}
|
||||
template <class _FLT> inline complex<_FLT>
|
||||
log10 (const complex<_FLT>& x)
|
||||
{
|
||||
return log (x) / log (10.0);
|
||||
}
|
||||
|
||||
template <class _FLT> istream& operator >> (istream&, complex<_FLT>&);
|
||||
template <class _FLT> ostream& operator << (ostream&, const complex<_FLT>&);
|
||||
} // extern "C++"
|
||||
|
Loading…
Reference in New Issue
Block a user