summaryrefslogtreecommitdiffstats
path: root/libg++/libstdc++/std/ldcomplex.h
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2008-06-01 00:03:21 +0000
committerpeter <peter@FreeBSD.org>2008-06-01 00:03:21 +0000
commita2be5f0c15218b0177d73b17d9bcb7589965d685 (patch)
treec9f0cd9c22378356a1716d32e13e70bc90f98b9c /libg++/libstdc++/std/ldcomplex.h
parent9e0f3cc19c9df1594c9cc36cfd8fddc83c52ad12 (diff)
downloadFreeBSD-src-a2be5f0c15218b0177d73b17d9bcb7589965d685.zip
FreeBSD-src-a2be5f0c15218b0177d73b17d9bcb7589965d685.tar.gz
Reorganize the gcc vendor import work area. This flattens out a bunch
of unnecessary path components that are relics of cvs2svn. (These are directory moves)
Diffstat (limited to 'libg++/libstdc++/std/ldcomplex.h')
-rw-r--r--libg++/libstdc++/std/ldcomplex.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/libg++/libstdc++/std/ldcomplex.h b/libg++/libstdc++/std/ldcomplex.h
new file mode 100644
index 0000000..95f90ae
--- /dev/null
+++ b/libg++/libstdc++/std/ldcomplex.h
@@ -0,0 +1,93 @@
+// The -*- C++ -*- long_double_complex class.
+// Copyright (C) 1994 Free Software Foundation
+
+// This file is part of the GNU ANSI C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+// As a special exception, if you link this library with files
+// compiled with a GNU compiler to produce an executable, this does not cause
+// the resulting executable to be covered by the GNU General Public License.
+// This exception does not however invalidate any other reasons why
+// the executable file might be covered by the GNU General Public License.
+
+// Written by Jason Merrill based upon the specification in the 27 May 1994
+// C++ working paper, ANSI document X3J16/94-0098.
+
+#ifndef __LDCOMPLEX__
+#define __LDCOMPLEX__
+
+#ifdef __GNUG__
+#pragma interface "ldcomplex"
+#endif
+
+extern "C++" {
+class complex<long double>
+{
+public:
+ complex (long double r = 0, long double i = 0): re (r), im (i) { }
+ complex (const complex<float>& r): re (r.real ()), im (r.imag ()) { }
+ complex (const complex<double>& r): re (r.real ()), im (r.imag ()) { }
+
+ complex& operator+= (const complex&);
+ complex& operator-= (const complex&);
+ complex& operator*= (const complex&);
+ complex& operator/= (const complex&);
+
+ long double real () const { return re; }
+ long double imag () const { return im; }
+private:
+ long double re, im;
+
+ // These functions are specified as friends for purposes of name injection;
+ // they do not actually reference private members.
+ friend long double real (const complex& x) { return x.real (); }
+ friend long double imag (const complex& x) { return x.imag (); }
+ friend complex operator + (const complex&, const complex&) __attribute__ ((const));
+ friend complex operator + (const complex&, long double) __attribute__ ((const));
+ friend complex operator + (long double, const complex&) __attribute__ ((const));
+ friend complex operator - (const complex&, const complex&) __attribute__ ((const));
+ friend complex operator - (const complex&, long double) __attribute__ ((const));
+ friend complex operator - (long double, const complex&) __attribute__ ((const));
+ friend complex operator * (const complex&, const complex&) __attribute__ ((const));
+ friend complex operator * (const complex&, long double) __attribute__ ((const));
+ friend complex operator * (long double, const complex&) __attribute__ ((const));
+ friend complex operator / (const complex&, const complex&) __attribute__ ((const));
+ friend complex operator / (const complex&, long double) __attribute__ ((const));
+ friend complex operator / (long double, const complex&) __attribute__ ((const));
+ friend bool operator == (const complex&, const complex&) __attribute__ ((const));
+ friend bool operator == (const complex&, long double) __attribute__ ((const));
+ friend bool operator == (long double, const complex&) __attribute__ ((const));
+ friend bool operator != (const complex&, const complex&) __attribute__ ((const));
+ friend bool operator != (const complex&, long double) __attribute__ ((const));
+ friend bool operator != (long double, const complex&) __attribute__ ((const));
+ friend complex polar (long double, long double) __attribute__ ((const));
+ friend complex pow (const complex&, const complex&) __attribute__ ((const));
+ friend complex pow (const complex&, long double) __attribute__ ((const));
+ friend complex pow (const complex&, int) __attribute__ ((const));
+ friend complex pow (long double, const complex&) __attribute__ ((const));
+ friend istream& operator>> (istream&, complex&);
+ friend ostream& operator<< (ostream&, const complex&);
+};
+
+inline complex<float>::complex (const complex<long double>& r)
+: re (r.real ()), im (r.imag ())
+{ }
+
+inline complex<double>::complex (const complex<long double>& r)
+: re (r.real ()), im (r.imag ())
+{ }
+} // extern "C++"
+
+#endif
OpenPOWER on IntegriCloud