32 #pragma interface "fcomplex"
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
; }
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__ */