Install msysDVLPR-1.0.0-alpha-1
[msysgit.git] / lib / gcc-lib / i686-pc-msys / 2.95.3-1 / include / g++-3 / std / fcomplex.h
blob2df6df8ffeee51d2b416cfdc3a9ae76c69d2fa45
28 #ifndef __FCOMPLEX__
29 #define __FCOMPLEX__
31 #ifdef __GNUG__
32 #pragma interface "fcomplex"
33 #endif
35 extern "C++" {
36 class complex<float>
38 public:
39 complex (float r = 0, float i = 0): re (r), im (i) { }
40 explicit complex (const complex<double>& r);
41 explicit complex (const complex<long double>& r);
43 complex& operator+= (const complex& r) { return __doapl (this, r); }
44 complex& operator-= (const complex& r) { return __doami (this, r); }
45 complex& operator*= (const complex& r) { return __doaml (this, r); }
46 complex& operator/= (const complex& r) { return __doadv (this, r); }
48 float real () const { return re; }
49 float imag () const { return im; }
50 private:
51 float re, im;
53 friend complex& __doapl<> (complex *, const complex&);
54 friend complex& __doami<> (complex *, const complex&);
55 friend complex& __doaml<> (complex *, const complex&);
56 friend complex& __doadv<> (complex *, const complex&);
58 #ifndef __STRICT_ANSI__
59 friend inline complex operator + (const complex& x, float y)
60 { return operator+<> (x, y); }
61 friend inline complex operator + (float x, const complex& y)
62 { return operator+<> (x, y); }
63 friend inline complex operator - (const complex& x, float y)
64 { return operator-<> (x, y); }
65 friend inline complex operator - (float x, const complex& y)
66 { return operator-<> (x, y); }
67 friend inline complex operator * (const complex& x, float y)
68 { return operator*<> (x, y); }
69 friend inline complex operator * (float x, const complex& y)
70 { return operator*<> (x, y); }
71 friend inline complex operator / (const complex& x, float y)
72 { return operator/<> (x, y); }
73 friend inline complex operator / (float x, const complex& y)
74 { return operator/<> (x, y); }
75 friend inline bool operator == (const complex& x, float y)
76 { return operator==<> (x, y); }
77 friend inline bool operator == (float x, const complex& y)
78 { return operator==<> (x, y); }
79 friend inline bool operator != (const complex& x, float y)
80 { return operator!=<> (x, y); }
81 friend inline bool operator != (float x, const complex& y)
82 { return operator!=<> (x, y); }
83 #endif /* __STRICT_ANSI__ */
87 #endif